From be19593aef54f7ccda30744197a47bccd645458b Mon Sep 17 00:00:00 2001 From: hatoo Date: Wed, 30 Oct 2024 17:32:23 +0900 Subject: [PATCH] clippy --- src/lib.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7d4582c..238706d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -206,17 +206,15 @@ impl + Send + Sync + 'static> MitmProxy { } fn get_certified_key(&self, host: String) -> Option { - if let Some(root_cert) = self.root_cert.as_ref() { - Some(if let Some(cache) = self.cert_cache.as_ref() { + self.root_cert.as_ref().map(|root_cert| { + if let Some(cache) = self.cert_cache.as_ref() { cache.get_with(host.clone(), move || { generate_cert(host, root_cert.borrow()) }) } else { generate_cert(host, root_cert.borrow()) - }) - } else { - None - } + } + }) } fn server_config(