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:
2020-05-02 13:08:20 +08:00
parent 57c757d770
commit 7853214680
2 changed files with 8 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ use std::{
lazy_static! {
pub static ref IS_ATTY: bool = is_atty();
static ref PRINT_MESSAGE_LOCK: Arc<Mutex<usize>> = Arc::new(Mutex::new(0));
static ref PRINT_MESSAGE_LOCK: Arc<Mutex<()>> = Arc::new(Mutex::new(()));
}
pub enum MessageType { INFO, OK, WARN, ERROR, DEBUG, }
@@ -40,7 +40,7 @@ pub fn print_message_ex(color: Option<term::color::Color>, h: &str, message: &st
let mut lock = PRINT_MESSAGE_LOCK.lock().unwrap();
print_color(color, true, h);
println!(" {}", message);
*lock += 1;
*lock = ();
}
pub fn print_message(mt: MessageType, message: &str) {