Fix a new nightly clippy "unwrap_or_else uses default" lint (#5131)

This commit is contained in:
teor 2022-09-13 09:59:07 +10:00 committed by GitHub
parent 2c0f906692
commit 43e4a29be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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<Self, FrameworkError> {
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.