Use contains combinator

As suggested by clippy, use the `contains` combinator instead of doing
manual range check on floats.
This commit is contained in:
Tobin Harding 2021-01-18 19:28:18 +11:00 committed by Steve Myers
parent 4686ebb420
commit 03b7c1b46b
No known key found for this signature in database
GPG Key ID: 8105A46B22C2D051

View File

@ -169,7 +169,7 @@ pub fn progress() -> (Sender<ProgressData>, Receiver<ProgressData>) {
impl Progress for Sender<ProgressData> {
fn update(&self, progress: f32, message: Option<String>) -> Result<(), Error> {
if progress < 0.0 || progress > 100.0 {
if !(0.0..=100.0).contains(&progress) {
return Err(Error::InvalidProgressValue(progress));
}