From 03b7c1b46b16f85a1240ab88efc608cbd4af95df Mon Sep 17 00:00:00 2001 From: Tobin Harding Date: Mon, 18 Jan 2021 19:28:18 +1100 Subject: [PATCH] Use contains combinator As suggested by clippy, use the `contains` combinator instead of doing manual range check on floats. --- src/blockchain/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); }