diff options
Diffstat (limited to 'src/ui.rs')
| -rw-r--r-- | src/ui.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ui.rs b/src/ui.rs new file mode 100644 index 0000000..38cbaa4 --- /dev/null +++ b/src/ui.rs @@ -0,0 +1,23 @@ +macro_rules! warn { + ($fmt:literal, $ex:expr) => {{ + use console::{style, Emoji}; + let formatstr = format!($fmt, $ex); + println!( + "{} {}", + style(Emoji("⚠️ ", "!")).red(), + style(formatstr).red() + ); + }}; +} + +macro_rules! success { + ($fmt:literal, $ex:expr) => {{ + use console::{style, Emoji}; + let formatstr = format!($fmt, $ex); + println!( + "{} {}", + style(Emoji("✅", "✓")).green(), + style(formatstr).green() + ); + }}; +} |
