dialogs: use `Cow<str>` to avoid cloning a String
[ouch.git] / src / macros.rs
blob723f3648141a9c33cfc767dfe418a71fe0f0ad83
1 use crate::NO_COLOR_IS_SET;
3 #[macro_export]
4 macro_rules! info {
6     ($writer:expr, $($arg:tt)*) => {
7         use crate::macros::_info_helper;
8         _info_helper();
9         println!($writer, $($arg)*);
10     };
11     ($writer:expr) => {
12         _info_helper();
13         println!($writer);
14     };
17 pub fn _info_helper() {
18     use crate::utils::colors::{reset, yellow};
20     if *NO_COLOR_IS_SET {
21         print!("[INFO] ");
22     } else {
23         print!("{}[INFO]{} ", yellow(), reset());
24     }