From: Tobin Harding Date: Mon, 18 Jan 2021 08:28:18 +0000 (+1100) Subject: Use contains combinator X-Git-Tag: v0.4.0~42 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/struct.OutOfRangeError.html?a=commitdiff_plain;h=03b7c1b46b16f85a1240ab88efc608cbd4af95df;p=bdk Use contains combinator As suggested by clippy, use the `contains` combinator instead of doing manual range check on floats. --- diff --git a/src/blockchain/mod.rs b/src/blockchain/mod.rs index 66538816..25c6055b 100644 --- a/src/blockchain/mod.rs +++ b/src/blockchain/mod.rs @@ -169,7 +169,7 @@ pub fn progress() -> (Sender, Receiver) { impl Progress for Sender { fn update(&self, progress: f32, message: Option) -> Result<(), Error> { - if progress < 0.0 || progress > 100.0 { + if !(0.0..=100.0).contains(&progress) { return Err(Error::InvalidProgressValue(progress)); }