Use contains combinator
As suggested by clippy, use the `contains` combinator instead of doing manual range check on floats.
This commit is contained in:
parent
4686ebb420
commit
03b7c1b46b
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user