Skip to content

Commit

Permalink
subscriber: fix dead code on some feature combos
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Aug 29, 2023
1 parent aea63f1 commit b85578f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tracing-subscriber/src/filter/directive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ enum ParseErrorKind {
// === impl DirectiveSet ===

impl<T> DirectiveSet<T> {
#[cfg(feature = "std")]
// this is only used by `env-filter`.
#[cfg(all(feature = "std", feature = "env-filter"))]
pub(crate) fn is_empty(&self) -> bool {
self.directives.is_empty()
}
Expand Down Expand Up @@ -388,7 +389,7 @@ impl FromStr for StaticDirective {
// === impl ParseError ===

impl ParseError {
#[cfg(feature = "std")]
#[cfg(all(feature = "std", feature = "env-filter"))]
pub(crate) fn new() -> Self {
ParseError {
kind: ParseErrorKind::Other(None),
Expand Down
2 changes: 2 additions & 0 deletions tracing-subscriber/src/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,8 @@ mod test {
Self { buf }
}

// this is currently only used by the JSON formatter tests. if we need it elsewhere in the future, feel free to remove the `#[cfg]` attribute!
#[cfg(feature = "json")]
pub(crate) fn buf(&self) -> MutexGuard<'_, Vec<u8>> {
self.buf.lock().unwrap()
}
Expand Down

0 comments on commit b85578f

Please sign in to comment.