From 504bb3ee9a120c55245076b98a9ffeb0509bd23d Mon Sep 17 00:00:00 2001 From: David Date: Fri, 6 Aug 2021 18:38:10 +0200 Subject: [PATCH] core: make Level and LevelFilter Hash (#1456) Fixes: #1376 Co-authored-by: Eliza Weisman --- tracing-core/src/metadata.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tracing-core/src/metadata.rs b/tracing-core/src/metadata.rs index f8eff6dea8..742c6fe6b8 100644 --- a/tracing-core/src/metadata.rs +++ b/tracing-core/src/metadata.rs @@ -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); /// Indicates that a string could not be parsed to a valid level.