From 128e7dd78ea57b0bc2be3cc440fc4bd92ff91c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Thu, 26 Nov 2020 16:45:57 +0100 Subject: [PATCH] more nightly clippy lints --- ad9959/src/lib.rs | 4 ++-- src/pounder/attenuators.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ad9959/src/lib.rs b/ad9959/src/lib.rs index 0f6b237..446825f 100644 --- a/ad9959/src/lib.rs +++ b/ad9959/src/lib.rs @@ -208,7 +208,7 @@ where ) -> Result { self.reference_clock_frequency = reference_clock_frequency; - if multiplier != 1 && (multiplier > 20 || multiplier < 4) { + if multiplier != 1 && !(4..=20).contains(&multiplier) { return Err(Error::Bounds); } @@ -438,7 +438,7 @@ where channel: Channel, amplitude: f32, ) -> Result { - if amplitude < 0.0 || amplitude > 1.0 { + if !(0.0..=1.0).contains(&litude) { return Err(Error::Bounds); } diff --git a/src/pounder/attenuators.rs b/src/pounder/attenuators.rs index 2ffa75f..156da9f 100644 --- a/src/pounder/attenuators.rs +++ b/src/pounder/attenuators.rs @@ -19,7 +19,7 @@ pub trait AttenuatorInterface { channel: Channel, attenuation: f32, ) -> Result { - if attenuation > 31.5 || attenuation < 0.0 { + if !(0.0..=31.5).contains(&attenuation) { return Err(Error::Bounds); }