diff options
author | Laurent <laurent.mazare@gmail.com> | 2024-01-08 07:19:59 +0100 |
---|---|---|
committer | Laurent <laurent.mazare@gmail.com> | 2024-01-08 07:19:59 +0100 |
commit | fb05af4c42a6343856f167893b19974ed6b50276 (patch) | |
tree | a946bf2ee6e0b3ac5b11734df4194842d67049ee /candle-core/benches/utils.rs | |
parent | ad075a5f7edb0114b820b3e99a19b17d0d25ec3b (diff) | |
download | candle-fb05af4c42a6343856f167893b19974ed6b50276.tar.gz candle-fb05af4c42a6343856f167893b19974ed6b50276.tar.bz2 candle-fb05af4c42a6343856f167893b19974ed6b50276.zip |
Avoid some unnecessary returns.
Diffstat (limited to 'candle-core/benches/utils.rs')
-rw-r--r-- | candle-core/benches/utils.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/candle-core/benches/utils.rs b/candle-core/benches/utils.rs index a93afc6e..3e8b3c57 100644 --- a/candle-core/benches/utils.rs +++ b/candle-core/benches/utils.rs @@ -25,13 +25,13 @@ impl BenchDevice for Device { } pub(crate) fn device() -> Result<Device> { - return if cfg!(feature = "metal") { + if cfg!(feature = "metal") { Device::new_metal(0) } else if cfg!(feature = "cuda") { Device::new_cuda(0) } else { Ok(Device::Cpu) - }; + } } pub(crate) fn bench_name<S: Into<String>>(name: S) -> String { @@ -39,7 +39,7 @@ pub(crate) fn bench_name<S: Into<String>>(name: S) -> String { } const fn device_variant() -> &'static str { - return if cfg!(feature = "metal") { + if cfg!(feature = "metal") { "metal" } else if cfg!(feature = "cuda") { "cuda" @@ -49,5 +49,5 @@ const fn device_variant() -> &'static str { "mkl" } else { "cpu" - }; + } } |