diff --git a/src/native/common_schema/etw_cs.rs b/src/native/common_schema/etw_cs.rs index 3802ae5..f769631 100644 --- a/src/native/common_schema/etw_cs.rs +++ b/src/native/common_schema/etw_cs.rs @@ -12,7 +12,7 @@ use tracelogging::*; use tracelogging_dynamic::EventBuilder; use tracing_subscriber::registry::{LookupSpan, SpanRef}; -thread_local! {static EBW: std::cell::RefCell = RefCell::new(EventBuilder::new());} +thread_local! {static EBW: RefCell = const { RefCell::new(EventBuilder::new()) } } pub(crate) struct CommonSchemaPartCBuilder<'a> { pub(crate) eb: &'a mut EventBuilder, diff --git a/src/native/common_schema/user_events_cs.rs b/src/native/common_schema/user_events_cs.rs index b6f9e87..1ab53f5 100644 --- a/src/native/common_schema/user_events_cs.rs +++ b/src/native/common_schema/user_events_cs.rs @@ -13,7 +13,7 @@ use std::{ }; use tracing_subscriber::registry::{LookupSpan, SpanRef}; -thread_local! {static EBW: std::cell::RefCell = RefCell::new(EventBuilder::new());} +thread_local! {static EBW: RefCell = const { RefCell::new(EventBuilder::new()) } } pub(crate) struct CommonSchemaPartCBuilder<'a> { pub(crate) eb: &'a mut EventBuilder, diff --git a/src/native/etw.rs b/src/native/etw.rs index 4e449ff..23885f7 100644 --- a/src/native/etw.rs +++ b/src/native/etw.rs @@ -13,7 +13,7 @@ pub(crate) static mut _start__etw_kw: usize = usize::from_ne_bytes(*b"RSETW000") #[link_section = ".rsdata$zRSETW9"] pub(crate) static mut _stop__etw_kw: usize = usize::from_ne_bytes(*b"RSETW999"); -thread_local! {static EBW: std::cell::RefCell = RefCell::new(EventBuilder::new());} +thread_local! {static EBW: RefCell = const { RefCell::new(EventBuilder::new()) } } struct Win32SystemTime { st: [u16; 8], diff --git a/src/native/user_events.rs b/src/native/user_events.rs index bc98b70..c6d30f5 100644 --- a/src/native/user_events.rs +++ b/src/native/user_events.rs @@ -17,7 +17,7 @@ extern "C" { #[used] static mut ETW_META_PTR: *const crate::_details::EventMetadata = core::ptr::null(); -thread_local! {static EBW: std::cell::RefCell = RefCell::new(EventBuilder::new());} +thread_local! {static EBW: RefCell = const { RefCell::new(EventBuilder::new()) } } impl AddFieldAndValue for &'_ mut eventheader_dynamic::EventBuilder { fn add_field_value(&mut self, fv: &FieldAndValue) {