repo.or.cz
/
ouch.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
dialogs: use `Cow<str>` to avoid cloning a String
[ouch.git]
/
src
/
macros.rs
blob
723f3648141a9c33cfc767dfe418a71fe0f0ad83
1
use crate::NO_COLOR_IS_SET;
2
3
#[macro_export]
4
macro_rules! info {
5
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
};
15
}
16
17
pub fn _info_helper() {
18
use crate::utils::colors::{reset, yellow};
19
20
if *NO_COLOR_IS_SET {
21
print!("[INFO] ");
22
} else {
23
print!("{}[INFO]{} ", yellow(), reset());
24
}
25
}