From b645b16687a8553427c48639c5618ba9a0c72ee7 Mon Sep 17 00:00:00 2001 From: Benjamin Rottler Date: Thu, 13 Jul 2023 14:03:57 +0200 Subject: [PATCH] Fix clippy errors --- auditor/src/client/mod.rs | 16 ++++++++-------- auditor/src/domain/component.rs | 2 +- collectors/slurm/src/sacctcaller.rs | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/auditor/src/client/mod.rs b/auditor/src/client/mod.rs index 3c11c815..961f6813 100644 --- a/auditor/src/client/mod.rs +++ b/auditor/src/client/mod.rs @@ -194,7 +194,7 @@ impl AuditorClient { .send() .await { - Ok(s) => matches!(s.error_for_status(), Ok(_)), + Ok(s) => s.error_for_status().is_ok(), Err(_) => false, } } @@ -342,7 +342,7 @@ impl AuditorClientBlocking { .get(format!("{}/health_check", &self.address)) .send() { - Ok(s) => matches!(s.error_for_status(), Ok(_)), + Ok(s) => s.error_for_status().is_ok(), Err(_) => false, } } @@ -494,7 +494,7 @@ mod tests { response .into_iter() - .zip(body.into_iter()) + .zip(body) .map(|(rr, br)| assert_eq!(rr, br)) .count(); } @@ -527,7 +527,7 @@ mod tests { response .into_iter() - .zip(body.into_iter()) + .zip(body) .map(|(rr, br)| assert_eq!(rr, br)) .count(); } @@ -893,7 +893,7 @@ mod tests { response .into_iter() - .zip(body.into_iter()) + .zip(body) .map(|(rr, br)| assert_eq!(rr, br)) .count(); } @@ -929,7 +929,7 @@ mod tests { response .into_iter() - .zip(body.into_iter()) + .zip(body) .map(|(rr, br)| assert_eq!(rr, br)) .count(); } @@ -1007,7 +1007,7 @@ mod tests { response .into_iter() - .zip(body.into_iter()) + .zip(body) .map(|(rr, br)| assert_eq!(rr, br)) .count(); } @@ -1043,7 +1043,7 @@ mod tests { response .into_iter() - .zip(body.into_iter()) + .zip(body) .map(|(rr, br)| assert_eq!(rr, br)) .count(); } diff --git a/auditor/src/domain/component.rs b/auditor/src/domain/component.rs index 9b40b7bc..71f619cf 100644 --- a/auditor/src/domain/component.rs +++ b/auditor/src/domain/component.rs @@ -160,7 +160,7 @@ impl PartialEq for ComponentTest { && s_amount.as_ref().unwrap() == o_amount.as_ref() && s_scores .into_iter() - .zip(o_scores.into_iter()) + .zip(o_scores) .fold(true, |acc, (a, b)| acc && a == b) } } diff --git a/collectors/slurm/src/sacctcaller.rs b/collectors/slurm/src/sacctcaller.rs index 1a75e5fe..c5b8d078 100644 --- a/collectors/slurm/src/sacctcaller.rs +++ b/collectors/slurm/src/sacctcaller.rs @@ -28,12 +28,12 @@ use crate::{ type Job = HashMap; static BATCH_REGEX: Lazy = Lazy::new(|| { - Regex::new(r#"^[0-9_]+\.batch$"#) + Regex::new(r"^[0-9_]+\.batch$") .expect("Could not construct essential Regex for matching job ids.") }); static SUB_REGEX: Lazy = Lazy::new(|| { - Regex::new(r#"^[0-9]+\.[0-9]*$"#) + Regex::new(r"^[0-9]+\.[0-9]*$") .expect("Could not construct essential Regex for matching job ids.") });