Mercurial > crates > nonstick
changeset 115:1e11a52b4665
Don't promise ordering for the log level.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sun, 29 Jun 2025 03:35:59 -0400 |
parents | 93d423b65555 |
children | a12706e42c9d |
files | src/logging.rs |
diffstat | 1 files changed, 3 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/logging.rs Sun Jun 29 03:30:51 2025 -0400 +++ b/src/logging.rs Sun Jun 29 03:35:59 2025 -0400 @@ -36,9 +36,9 @@ /// The levels are in descending order of importance and correspond roughly /// to the similarly-named levels in the `log` crate. /// -/// In all implementations, these are ordered such that `Error`, `Warning`, -/// `Info`, and `Debug` are in ascending order. -#[derive(Debug, PartialEq, Ord, PartialOrd, Eq)] +/// Their values are ordered monotonically, either increasing or decreasing, +/// depending upon the implementation. +#[derive(Debug, PartialEq, Eq)] #[repr(i32)] pub enum Level { Error = levels::ERROR, @@ -144,13 +144,6 @@ use std::cell::RefCell; #[test] - fn test_order() { - assert!(Level::Error < Level::Warning); - assert!(Level::Warning < Level::Info); - assert!(Level::Info < Level::Debug); - } - - #[test] fn test_logging() { struct Logger(RefCell<Vec<(Level, String)>>);