Fix a new nightly clippy "unwrap_or_else uses default" lint (#5131)
This commit is contained in:
parent
2c0f906692
commit
43e4a29be2
|
|
@ -463,7 +463,7 @@ where
|
||||||
tx
|
tx
|
||||||
});
|
});
|
||||||
let nonces = Arc::new(futures::lock::Mutex::new(HashSet::new()));
|
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 our_services = self.our_services.unwrap_or_else(PeerServices::empty);
|
||||||
let relay = self.relay.unwrap_or(false);
|
let relay = self.relay.unwrap_or(false);
|
||||||
let network = config.network;
|
let network = config.network;
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ pub struct Tracing {
|
||||||
impl Tracing {
|
impl Tracing {
|
||||||
/// Try to create a new [`Tracing`] component with the given `filter`.
|
/// Try to create a new [`Tracing`] component with the given `filter`.
|
||||||
pub fn new(config: TracingSection) -> Result<Self, FrameworkError> {
|
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;
|
let flame_root = &config.flamegraph;
|
||||||
|
|
||||||
// Builds a lossy NonBlocking logger with a default line limit of 128_000 or an explicit buffer_limit.
|
// Builds a lossy NonBlocking logger with a default line limit of 128_000 or an explicit buffer_limit.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue