From d91f9767bbf93e0def0a336a7aaf5ca984aeba81 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Tue, 24 Oct 2023 18:28:25 -0500 Subject: [PATCH] policy: clippage Signed-off-by: William Woodruff --- src/rust/cryptography-x509-validation/src/policy/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/rust/cryptography-x509-validation/src/policy/mod.rs b/src/rust/cryptography-x509-validation/src/policy/mod.rs index b7a3cd7d8aec..795e00bd24b2 100644 --- a/src/rust/cryptography-x509-validation/src/policy/mod.rs +++ b/src/rust/cryptography-x509-validation/src/policy/mod.rs @@ -369,11 +369,12 @@ impl<'a, B: CryptoOps> Policy<'a, B> { .chain(self.ee_extension_policies.iter()) .map(|p| p.oid.clone()) .collect::>(); - let unchecked_extensions = critical_extensions - .difference(&checked_extensions) - .collect::>(); - if !unchecked_extensions.is_empty() { + if !critical_extensions + .difference(&checked_extensions) + .next() + .is_none() + { // TODO: Render the OIDs here. return Err("certificate contains unaccounted-for critical extensions".into()); }