}
pub(crate) fn requires_unknown_bits(&self) -> bool {
- for (idx, &byte) in self.flags.iter().enumerate() {
- if idx != 0 && (byte & 0x55) != 0 {
- return true;
- } else if idx == 0 && (byte & 0x14) != 0 {
- return true;
- }
- }
- return false;
+ self.flags.iter().enumerate().any(|(idx, &byte)| {
+ ( idx != 0 && (byte & 0x55) != 0 ) || ( idx == 0 && (byte & 0x14) != 0 )
+ })
}
pub(crate) fn supports_unknown_bits(&self) -> bool {
- for (idx, &byte) in self.flags.iter().enumerate() {
- if idx != 0 && byte != 0 {
- return true;
- } else if idx == 0 && (byte & 0xc4) != 0 {
- return true;
- }
- }
- return false;
+ self.flags.iter().enumerate().any(|(idx, &byte)| {
+ ( idx != 0 && byte != 0 ) || ( idx == 0 && (byte & 0xc4) != 0 )
+ })
}
}
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,
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> {