Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subscriber: fix unused method warnings for Extensions #1686

Merged
merged 1 commit into from
Oct 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tracing-subscriber/src/registry/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub struct Extensions<'a> {
}

impl<'a> Extensions<'a> {
#[cfg(feature = "registry")]
pub(crate) fn new(inner: RwLockReadGuard<'a, ExtensionsInner>) -> Self {
Self { inner }
}
Expand All @@ -59,6 +60,7 @@ pub struct ExtensionsMut<'a> {
}

impl<'a> ExtensionsMut<'a> {
#[cfg(feature = "registry")]
pub(crate) fn new(inner: RwLockWriteGuard<'a, ExtensionsInner>) -> Self {
Self { inner }
}
Expand Down Expand Up @@ -120,6 +122,7 @@ pub(crate) struct ExtensionsInner {

impl ExtensionsInner {
/// Create an empty `Extensions`.
#[cfg(any(test, feature = "registry"))]
#[inline]
pub(crate) fn new() -> ExtensionsInner {
ExtensionsInner {
Expand Down Expand Up @@ -179,6 +182,7 @@ impl ExtensionsInner {
///
/// This permits the hash map allocation to be pooled by the registry so
/// that future spans will not need to allocate new hashmaps.
#[cfg(any(test, feature = "registry"))]
pub(crate) fn clear(&mut self) {
self.map.clear();
}
Expand Down