From 1e4e5924ca15c065813acd8ee7cc98025a758561 Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 15 Apr 2021 12:40:13 +1000 Subject: [PATCH] clippy: factor common code out of an if-else block --- zebrad/src/application.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zebrad/src/application.rs b/zebrad/src/application.rs index a6213df01..1e32c4901 100644 --- a/zebrad/src/application.rs +++ b/zebrad/src/application.rs @@ -249,21 +249,18 @@ impl Application for ZebradApp { .unwrap_or(false); // Ignore the tracing filter for short-lived commands + let mut tracing_config = cfg_ref.tracing.clone(); if is_server { // Override the default tracing filter based on the command-line verbosity. - let mut tracing_config = cfg_ref.tracing.clone(); tracing_config.filter = tracing_config .filter .or_else(|| Some(default_filter.to_owned())); - - components.push(Box::new(Tracing::new(tracing_config)?)); } else { // Don't apply the configured filter for short-lived commands. - let mut tracing_config = cfg_ref.tracing.clone(); tracing_config.filter = Some(default_filter.to_owned()); tracing_config.flamegraph = None; - components.push(Box::new(Tracing::new(tracing_config)?)); } + components.push(Box::new(Tracing::new(tracing_config)?)); // Activate the global span, so it's visible when we load the other // components. Space is at a premium here, so we use an empty message,