Skip to content

Commit

Permalink
cleanup warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
  • Loading branch information
hawkw committed Apr 20, 2022
1 parent b6c70b0 commit 18cc711
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion tracing-core/src/callsite.rs
Expand Up @@ -15,7 +15,6 @@ use crate::{
dispatcher::Dispatch,
metadata::{LevelFilter, Metadata},
subscriber::Interest,
Once,
};

use self::dispatchers::Dispatchers;
Expand Down
6 changes: 5 additions & 1 deletion tracing-core/src/dispatcher.rs
Expand Up @@ -134,14 +134,15 @@ use crate::stdlib::{
fmt,
sync::{
atomic::{AtomicBool, AtomicUsize, Ordering},
Arc, Weak,
Arc,
},
};

#[cfg(feature = "std")]
use crate::stdlib::{
cell::{Cell, RefCell, RefMut},
error,
sync::Weak,
};

/// `Dispatch` trace data to a [`Subscriber`].
Expand Down Expand Up @@ -387,6 +388,7 @@ fn get_global() -> Option<&'static Dispatch> {
}
}

#[cfg(feature = "std")]
pub(crate) struct Registrar(Weak<dyn Subscriber + Send + Sync>);

impl Dispatch {
Expand All @@ -412,6 +414,7 @@ impl Dispatch {
me
}

#[cfg(feature = "std")]
pub(crate) fn registrar(&self) -> Registrar {
Registrar(Arc::downgrade(&self.subscriber))
}
Expand Down Expand Up @@ -651,6 +654,7 @@ where
}
}

#[cfg(feature = "std")]
impl Registrar {
pub(crate) fn upgrade(&self) -> Option<Dispatch> {
self.0.upgrade().map(|subscriber| Dispatch { subscriber })
Expand Down

0 comments on commit 18cc711

Please sign in to comment.