From 917f5f73af2f162bf7b18f374352b4e9dbcd3ebe Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 2 Jun 2022 15:59:53 +0200 Subject: [PATCH] tree wide: clippy lint fixes most (not all) where done automatically Signed-off-by: Thomas Lamprecht --- proxmox-rest-server/src/worker_task.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/proxmox-rest-server/src/worker_task.rs b/proxmox-rest-server/src/worker_task.rs index b60282f8..a1eea832 100644 --- a/proxmox-rest-server/src/worker_task.rs +++ b/proxmox-rest-server/src/worker_task.rs @@ -262,10 +262,8 @@ pub fn rotate_task_log_archive( } } } - } else { - if let Err(err) = std::fs::remove_file(&file_name) { - log::error!("could not remove {:?}: {}", file_name, err); - } + } else if let Err(err) = std::fs::remove_file(&file_name) { + log::error!("could not remove {:?}: {}", file_name, err); } } } @@ -966,7 +964,7 @@ impl WorkerTask { /// Set progress indicator pub fn progress(&self, progress: f64) { - if progress >= 0.0 && progress <= 1.0 { + if (0.0..=1.0).contains(&progress) { let mut data = self.data.lock().unwrap(); data.progress = progress; } else {