2020-02-20 19:11:53 +00:00
|
|
|
macro_rules! warn {
|
|
|
|
($fmt:literal, $ex:expr) => {{
|
2021-03-19 09:16:07 +00:00
|
|
|
use std::env;
|
2020-02-20 19:11:53 +00:00
|
|
|
use console::{style, Emoji};
|
|
|
|
let formatstr = format!($fmt, $ex);
|
2021-03-19 09:16:07 +00:00
|
|
|
match env::var("NO_EMOJI").is_ok() {
|
|
|
|
true => {
|
|
|
|
println!(
|
|
|
|
"{} {}",
|
|
|
|
style("!").red(),
|
|
|
|
style(formatstr).red()
|
|
|
|
);
|
|
|
|
},
|
|
|
|
false => {
|
|
|
|
println!(
|
|
|
|
"{} {}",
|
|
|
|
style(Emoji("⚠️ ", "!")).red(),
|
|
|
|
style(formatstr).red()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2020-02-20 19:11:53 +00:00
|
|
|
}};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! success {
|
|
|
|
($fmt:literal, $ex:expr) => {{
|
2021-03-19 09:16:07 +00:00
|
|
|
use std::env;
|
2020-02-20 19:11:53 +00:00
|
|
|
use console::{style, Emoji};
|
|
|
|
let formatstr = format!($fmt, $ex);
|
2021-03-19 09:16:07 +00:00
|
|
|
match env::var("NO_EMOJI").is_ok() {
|
|
|
|
true => {
|
|
|
|
println!(
|
|
|
|
"{} {}",
|
|
|
|
style("✓").green(),
|
|
|
|
style(formatstr).green()
|
|
|
|
);
|
|
|
|
},
|
|
|
|
false => {
|
|
|
|
println!(
|
|
|
|
"{} {}",
|
|
|
|
style(Emoji("✅", "✓")).green(),
|
|
|
|
style(formatstr).green()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2020-02-20 19:11:53 +00:00
|
|
|
}};
|
|
|
|
}
|