1
0
mirror of https://github.com/jht5945/rust_util.git synced 2025-12-27 15:40:03 +08:00

fix: clippy

This commit is contained in:
2021-05-30 01:28:16 +08:00
parent c8a0f22425
commit 8d4b8aa1e0
10 changed files with 75 additions and 61 deletions

View File

@@ -8,6 +8,7 @@ lazy_static! {
static ref PRINT_MESSAGE_LOCK: Arc<Mutex<()>> = Arc::new(Mutex::new(()));
}
#[allow(clippy::upper_case_acronyms)]
#[derive(Clone, Copy)]
pub enum MessageType { DEBUG, INFO, OK, WARN, ERROR }
@@ -92,7 +93,7 @@ pub fn is_logger_level_enabled(mt: MessageType) -> bool {
mt.get_u8_value() >= logger_level.get_u8_value()
}
pub fn when<F>(mt: MessageType, f: F) where F: Fn() -> () {
pub fn when<F>(mt: MessageType, f: F) where F: Fn() {
if is_logger_level_enabled(mt) {
f();
}