From 43e4a29be2ef1bc860bf27dbef3ffb9e6552ac55 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 13 Sep 2022 09:59:07 +1000 Subject: [PATCH] Fix a new nightly clippy "unwrap_or_else uses default" lint (#5131) --- zebra-network/src/peer/handshake.rs | 2 +- zebrad/src/components/tracing/component.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zebra-network/src/peer/handshake.rs b/zebra-network/src/peer/handshake.rs index 2b57fc21..dcbc166b 100644 --- a/zebra-network/src/peer/handshake.rs +++ b/zebra-network/src/peer/handshake.rs @@ -463,7 +463,7 @@ where tx }); let nonces = Arc::new(futures::lock::Mutex::new(HashSet::new())); - let user_agent = self.user_agent.unwrap_or_else(|| "".to_string()); + let user_agent = self.user_agent.unwrap_or_default(); let our_services = self.our_services.unwrap_or_else(PeerServices::empty); let relay = self.relay.unwrap_or(false); let network = config.network; diff --git a/zebrad/src/components/tracing/component.rs b/zebrad/src/components/tracing/component.rs index d2bca164..641a810e 100644 --- a/zebrad/src/components/tracing/component.rs +++ b/zebrad/src/components/tracing/component.rs @@ -44,7 +44,7 @@ pub struct Tracing { impl Tracing { /// Try to create a new [`Tracing`] component with the given `filter`. pub fn new(config: TracingSection) -> Result { - let filter = config.filter.unwrap_or_else(|| "".to_string()); + let filter = config.filter.unwrap_or_default(); let flame_root = &config.flamegraph; // Builds a lossy NonBlocking logger with a default line limit of 128_000 or an explicit buffer_limit.