core: make Level and LevelFilter Hash (#1456)

Fixes: #1376

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
David 2021-08-06 18:38:10 +02:00 committed by Eliza Weisman
parent 494cf1b7b5
commit 504bb3ee9a

View File

@ -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`].
@ -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.