Skip to content

Commit

Permalink
core: make Level and LevelFilter Hash (#1456)
Browse files Browse the repository at this point in the history
Fixes: #1376

Co-authored-by: Eliza Weisman <[email protected]>
  • Loading branch information
dvdplm and hawkw committed Aug 17, 2021
1 parent 494cf1b commit 504bb3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tracing-core/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ pub struct Kind(KindInner);
/// [`Subscriber::max_level_hint`]: crate::subscriber::Subscriber::max_level_hint
/// [subscriber]: crate::subscriber::Subscriber
/// [envfilter]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub struct Level(LevelInner);

/// A filter comparable to a verbosity [`Level`].
Expand All @@ -236,7 +236,7 @@ pub struct Level(LevelInner);
///
/// [`OFF`]: LevelFilter::OFF
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq)]
#[derive(Copy, Clone, Eq, PartialEq, Hash)]
pub struct LevelFilter(Option<Level>);

/// Indicates that a string could not be parsed to a valid level.
Expand Down

0 comments on commit 504bb3e

Please sign in to comment.