Skip to content

Commit

Permalink
subscriber: fix unused method warnings for Extensions (#1686)
Browse files Browse the repository at this point in the history
## Motivation

Currently, there are some `pub(crate)` methods on the `Extensions`,
`ExtensionsMut`, and `ExtensionsInner` types that are only used when the
"registry" feature is enabled. However, the _types_ exist when the "std"
feature flag is enabled, so those methods produce unused method
warnings.

## Solution

This commit adds `#[cfg(feature = "registry")]` to those methods, fixing
the warning.
  • Loading branch information
hawkw committed Oct 25, 2021
1 parent fd12ae1 commit 94ca5e7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tracing-subscriber/src/registry/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ pub(crate) struct ExtensionsInner {

impl ExtensionsInner {
/// Create an empty `Extensions`.
#[cfg(any(test, feature = "registry"))]
#[inline]
#[cfg(any(test, feature = "registry"))]
pub(crate) fn new() -> ExtensionsInner {
Expand Down

0 comments on commit 94ca5e7

Please sign in to comment.