diff --git a/profiling/src/lib.rs b/profiling/src/lib.rs index 64c325c335..8fc58fb841 100644 --- a/profiling/src/lib.rs +++ b/profiling/src/lib.rs @@ -1,4 +1,3 @@ -use std::thread::current; use std::time::Duration; use tracing_subscriber::prelude::*; use tracing_subscriber::Registry; @@ -15,7 +14,7 @@ pub use tracing::{info_span, instrument}; pub struct Profiler { #[cfg(feature = "tracing-chrome")] /// [`FlushGuard`] must not be dropped until the application scope is dropped for accurate tracing. - guard: FlushGuard, + _guard: FlushGuard, } pub fn init() -> Profiler { @@ -45,7 +44,7 @@ pub fn init() -> Profiler { time ) }) - .unwrap_or("trace.json".to_string()); + .unwrap_or_else(|| "trace.json".to_string()); let path = format!( "{}/{}", @@ -96,6 +95,6 @@ pub fn init() -> Profiler { Profiler { #[cfg(feature = "tracing-chrome")] - guard, + _guard: guard, } }