We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 437fc46 commit bfb5847Copy full SHA for bfb5847
1 file changed
components-rs/log.rs
@@ -38,8 +38,10 @@ pub static mut ddog_log_callback: Option<extern "C" fn(CharSlice)> = None;
38
39
// Avoid RefCell for performance
40
std::thread_local! {
41
- static LOGGED_MSGS: RefCell<BTreeSet<String>> = RefCell::default();
42
- static TRACING_GUARDS: RefCell<Option<tracing_core::dispatcher::DefaultGuard>> = RefCell::default();
+ static LOGGED_MSGS: RefCell<BTreeSet<String>> = const { RefCell::new(BTreeSet::new()) };
+ static TRACING_GUARDS: RefCell<Option<tracing_core::dispatcher::DefaultGuard>> = const { RefCell::new(None) };
43
+
44
+ // todo: MSRV 1.85+ make this const with HashMap::with_hasher
45
static COUNTERS: RefCell<HashMap<Level, u32>> = RefCell::default();
46
}
47
0 commit comments