Merge pull request #307 from dongcarl/2019-02-derive-partialeq

util: Derive PartialEq for Level
This commit is contained in:
Matt Corallo 2019-02-24 14:25:58 -05:00 committed by GitHub
commit 788bd915c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@ use std::sync::Arc;
static LOG_LEVEL_NAMES: [&'static str; 6] = ["OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"];
/// An enum representing the available verbosity levels of the logger.
#[derive(Copy, Clone, Eq, Debug, Hash)]
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub enum Level {
///Designates logger being silent
Off,
@ -37,13 +37,6 @@ pub enum Level {
Trace,
}
impl PartialEq for Level {
#[inline]
fn eq(&self, other: &Level) -> bool {
*self as usize == *other as usize
}
}
impl PartialOrd for Level {
#[inline]
fn partial_cmp(&self, other: &Level) -> Option<cmp::Ordering> {