Skip to content

Commit

Permalink
Fix cargo lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
borntyping committed Dec 29, 2023
1 parent 5f1cfd9 commit f12a2b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "simple_logger"
version = "4.3.2"
version = "4.3.3"
license = "MIT"
authors = ["Sam Clements <[email protected]>"]
description = "A logger that prints all messages with a readable output format"
Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ impl SimpleLogger {
#[must_use = "You must call init() to begin logging"]
pub fn with_module_level(mut self, target: &str, level: LevelFilter) -> SimpleLogger {
self.module_levels.push((target.to_string(), level));
self.module_levels.sort_by_key(|(name, _level)| name.len().wrapping_neg());
self.module_levels
.sort_by_key(|(name, _level)| name.len().wrapping_neg());
self
}

Expand All @@ -228,7 +229,8 @@ impl SimpleLogger {
)]
pub fn with_target_levels(mut self, target_levels: HashMap<String, LevelFilter>) -> SimpleLogger {
self.module_levels = target_levels.into_iter().collect();
self.module_levels.sort_by_key(|(name, _level)| name.len().wrapping_neg());
self.module_levels
.sort_by_key(|(name, _level)| name.len().wrapping_neg());
self
}

Expand Down

0 comments on commit f12a2b3

Please sign in to comment.