Skip to content

Commit

Permalink
Fix build and a couple clippy lints.
Browse files Browse the repository at this point in the history
  • Loading branch information
thoren-d committed Mar 15, 2024
1 parent 8e47c99 commit 51595cd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use std::{

thread_local! {
static OUT: RefCell<Option<Sender<Message>>> = RefCell::new(None);
static TID: RefCell<Option<u64>> = RefCell::new(None);
static TID: RefCell<Option<usize>> = RefCell::new(None);
}

type NameFn<S> = Box<dyn Fn(&EventOrSpan<'_, '_, S>) -> String + Send + Sync>;
Expand Down Expand Up @@ -88,7 +88,7 @@ where
include_args: false,
include_locations: true,
trace_style: TraceStyle::Threaded,
_inner: PhantomData::default(),
_inner: PhantomData,
}
}

Expand Down Expand Up @@ -240,7 +240,7 @@ impl Drop for FlushGuard {
}

struct Callsite {
tid: u64,
tid: usize,
name: String,
target: String,
file: Option<&'static str>,
Expand All @@ -252,7 +252,7 @@ enum Message {
Enter(f64, Callsite, Option<u64>),
Event(f64, Callsite),
Exit(f64, Callsite, Option<u64>),
NewThread(u64, String),
NewThread(usize, String),
Flush,
Drop,
StartNew(Option<Box<dyn Write + Send>>),
Expand Down Expand Up @@ -297,7 +297,7 @@ where
write.write_all(b"[\n").unwrap();

let mut has_started = false;
let mut thread_names: Vec<(u64, String)> = Vec::new();
let mut thread_names: Vec<(usize, String)> = Vec::new();
for msg in rx {
if let Message::Flush = &msg {
write.flush().unwrap();
Expand Down Expand Up @@ -413,13 +413,13 @@ where
include_args: builder.include_args,
include_locations: builder.include_locations,
trace_style: builder.trace_style,
_inner: PhantomData::default(),
_inner: PhantomData,
};

(layer, guard)
}

fn get_tid(&self) -> (u64, bool) {
fn get_tid(&self) -> (usize, bool) {
TID.with(|value| {
let tid = *value.borrow();
match tid {
Expand Down

0 comments on commit 51595cd

Please sign in to comment.