From 96c87bca71baa89d76e15c5859068f9a88de15af Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 29 Mar 2021 09:50:15 +1100 Subject: [PATCH] Avoid local variables if not necessary We can initialize the env filter without `format!` when the variables are not used anywhere else. --- monero-harness/tests/testutils/mod.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/monero-harness/tests/testutils/mod.rs b/monero-harness/tests/testutils/mod.rs index 2aad364e..4ab21589 100644 --- a/monero-harness/tests/testutils/mod.rs +++ b/monero-harness/tests/testutils/mod.rs @@ -7,16 +7,8 @@ use tracing::subscriber::DefaultGuard; /// let _guard = init_tracing(); /// ``` pub fn init_tracing() -> DefaultGuard { - let global_filter = tracing::Level::WARN; - let test_filter = tracing::Level::DEBUG; - let monero_harness_filter = tracing::Level::DEBUG; - let monero_rpc_filter = tracing::Level::DEBUG; - use tracing_subscriber::util::SubscriberInitExt as _; tracing_subscriber::fmt() - .with_env_filter(format!( - "{},test={},monero_harness={},monero_rpc={}", - global_filter, test_filter, monero_harness_filter, monero_rpc_filter, - )) + .with_env_filter("warn,test=debug,monero_harness=debug,monero_rpc=debug") .set_default() }