clippy: factor common code out of an if-else block
This commit is contained in:
parent
7d36a5e2c3
commit
1e4e5924ca
|
@ -249,21 +249,18 @@ impl Application for ZebradApp {
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
|
|
||||||
// Ignore the tracing filter for short-lived commands
|
// Ignore the tracing filter for short-lived commands
|
||||||
|
let mut tracing_config = cfg_ref.tracing.clone();
|
||||||
if is_server {
|
if is_server {
|
||||||
// Override the default tracing filter based on the command-line verbosity.
|
// Override the default tracing filter based on the command-line verbosity.
|
||||||
let mut tracing_config = cfg_ref.tracing.clone();
|
|
||||||
tracing_config.filter = tracing_config
|
tracing_config.filter = tracing_config
|
||||||
.filter
|
.filter
|
||||||
.or_else(|| Some(default_filter.to_owned()));
|
.or_else(|| Some(default_filter.to_owned()));
|
||||||
|
|
||||||
components.push(Box::new(Tracing::new(tracing_config)?));
|
|
||||||
} else {
|
} else {
|
||||||
// Don't apply the configured filter for short-lived commands.
|
// 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.filter = Some(default_filter.to_owned());
|
||||||
tracing_config.flamegraph = None;
|
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
|
// 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,
|
// components. Space is at a premium here, so we use an empty message,
|
||||||
|
|
Loading…
Reference in New Issue