Skip to content

Commit 788bd91

Browse files
authored
Merge pull request #307 from dongcarl/2019-02-derive-partialeq
util: Derive PartialEq for Level
2 parents fd26091 + abe3fa1 commit 788bd91

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/util/logger.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use std::sync::Arc;
2121
static LOG_LEVEL_NAMES: [&'static str; 6] = ["OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"];
2222

2323
/// An enum representing the available verbosity levels of the logger.
24-
#[derive(Copy, Clone, Eq, Debug, Hash)]
24+
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
2525
pub enum Level {
2626
///Designates logger being silent
2727
Off,
@@ -37,13 +37,6 @@ pub enum Level {
3737
Trace,
3838
}
3939

40-
impl PartialEq for Level {
41-
#[inline]
42-
fn eq(&self, other: &Level) -> bool {
43-
*self as usize == *other as usize
44-
}
45-
}
46-
4740
impl PartialOrd for Level {
4841
#[inline]
4942
fn partial_cmp(&self, other: &Level) -> Option<cmp::Ordering> {

0 commit comments

Comments
 (0)