From 4bdb8bb925c675c0e1faf22832eaa8d2ed34867a Mon Sep 17 00:00:00 2001 From: Martin Hoffmann Date: Thu, 23 Jan 2025 14:46:24 +0100 Subject: [PATCH] Clippy-suggested code improvements. --- src/commons/bgp/analyser.rs | 10 +++++----- src/daemon/auth/providers/openid_connect/provider.rs | 6 +++--- tests/functional_keyroll.rs | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/commons/bgp/analyser.rs b/src/commons/bgp/analyser.rs index 46cd0c629..6f3f3f7b8 100644 --- a/src/commons/bgp/analyser.rs +++ b/src/commons/bgp/analyser.rs @@ -724,19 +724,19 @@ mod tests { let entry_expect_roa = |x: &str, y| { let x = x.to_string(); - assert!(report.entries().into_iter().any(|s| + assert!(report.entries().iter().any(|s| s.state() == y && s.configured_roa().to_string() == x - )); + )); }; let entry_expect_ann = |x: &str, y: u32, z: BgpAnalysisState| { let x = x.to_string(); - assert!(report.entries().into_iter().any(|s| + assert!(report.entries().iter().any(|s| s.state() == z && - s.announcement().asn().clone() == AsNumber::new(y) && + *s.announcement().asn() == AsNumber::new(y) && s.announcement().prefix().to_string() == x - )); + )); }; entry_expect_roa("2a04:b907::/48-48 => 0", BgpAnalysisState::RoaAs0Redundant); diff --git a/src/daemon/auth/providers/openid_connect/provider.rs b/src/daemon/auth/providers/openid_connect/provider.rs index f335cfd20..aac1389e8 100644 --- a/src/daemon/auth/providers/openid_connect/provider.rs +++ b/src/daemon/auth/providers/openid_connect/provider.rs @@ -998,9 +998,9 @@ impl OpenIDConnectAuthProvider { None } - async fn get_connection<'a>( - &'_ self, - ) -> KrillResult>> + async fn get_connection( + &self, + ) -> KrillResult>> { let conn_guard = self.conn.read().await; diff --git a/tests/functional_keyroll.rs b/tests/functional_keyroll.rs index acfdc2c61..f73ad17bf 100644 --- a/tests/functional_keyroll.rs +++ b/tests/functional_keyroll.rs @@ -209,7 +209,7 @@ impl common::KrillServer { //------------ Extend ExpectedObjects ---------------------------------------- -impl<'a> common::ExpectedObjects<'a> { +impl common::ExpectedObjects<'_> { pub async fn wait_for_manifest_current_key(&self) -> bool { let current_key = self.server.ca_key_for_rcn( self.ca, &common::rcn(0)