Skip to content

Commit 6ad45ef

Browse files
dvdplmhawkw
andauthored
core: make Level and LevelFilter Hash (#1456)
Fixes: #1376 Co-authored-by: Eliza Weisman <eliza@buoyant.io>
1 parent aea1a80 commit 6ad45ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tracing-core/src/metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ pub struct Kind(KindInner);
221221
/// [`Collect::max_level_hint`]: crate::collect::Collect::max_level_hint
222222
/// [collector]: crate::collect::Collect
223223
/// [envfilter]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html
224-
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
224+
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
225225
pub struct Level(LevelInner);
226226

227227
/// A filter comparable to a verbosity [`Level`].
@@ -238,7 +238,7 @@ pub struct Level(LevelInner);
238238
///
239239
/// [`OFF`]: LevelFilter::OFF
240240
#[repr(transparent)]
241-
#[derive(Copy, Clone, Eq, PartialEq)]
241+
#[derive(Copy, Clone, Eq, PartialEq, Hash)]
242242
pub struct LevelFilter(Option<Level>);
243243

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

0 commit comments

Comments
 (0)