style: fix clippy
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -23,17 +23,22 @@ use cmd_new::CommandNew;
|
||||
($($arg:tt)+) => ( crate::print_wa(&format!($($arg)+)); )
|
||||
}
|
||||
|
||||
const GREEN: &str = "\x1B[92m";
|
||||
const YELLOW: &str = "\x1B[93m";
|
||||
const BOLD: &str = "\x1B[1m";
|
||||
const END: &str = "\x1B[0m";
|
||||
|
||||
#[inline]
|
||||
fn print_in (msg: &str) {
|
||||
println!("{b}[INFO]{e} {m}", b = "\x1B[1m", e = "\x1B[0m", m = msg);
|
||||
println!("{b}[INFO]{e} {m}", b = BOLD, e = END, m = msg);
|
||||
}
|
||||
#[inline]
|
||||
fn print_ok (msg: &str) {
|
||||
println!("{g}{b}[ OK ]{e} {g}{m}{e}", g = "\x1B[92m", b = "\x1B[1m", e = "\x1B[0m", m = msg);
|
||||
println!("{g}{b}[ OK ]{e} {g}{m}{e}", g = GREEN, b = BOLD, e = END, m = msg);
|
||||
}
|
||||
#[inline]
|
||||
fn print_wa (msg: &str) {
|
||||
println!("{g}{b}[WARN]{e} {g}{m}{e}", g = "\x1B[93m", b = "\x1B[1m", e = "\x1B[0m", m = msg);
|
||||
println!("{g}{b}[WARN]{e} {g}{m}{e}", g = YELLOW, b = BOLD, e = END, m = msg);
|
||||
}
|
||||
|
||||
fn main() -> CommandError {
|
||||
|
||||
Reference in New Issue
Block a user