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 authored Aug 6, 2021
1 parent aea1a80 commit 6ad45ef
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 @@ -221,7 +221,7 @@ pub struct Kind(KindInner);
/// [`Collect::max_level_hint`]: crate::collect::Collect::max_level_hint
/// [collector]: crate::collect::Collect
/// [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 @@ -238,7 +238,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 6ad45ef

Please sign in to comment.