mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
25 lines
494 B
Rust
25 lines
494 B
Rust
#[macro_export]
|
|
macro_rules! outln {
|
|
($($tt:tt)*) => {{
|
|
use std::io::Write;
|
|
writeln!(std::io::stdout(), $($tt)*)
|
|
}}
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! errln {
|
|
($($tt:tt)*) => {{
|
|
use std::io::Write;
|
|
writeln!(std::io::stderr(), $($tt)*)
|
|
}}
|
|
}
|
|
|
|
/// Like [`write!`] but immediately flushes the writer afterwards.
|
|
#[macro_export]
|
|
macro_rules! writef {
|
|
($dst:expr, $($arg:tt)*) => {{
|
|
use std::io::Write as _;
|
|
let dst = &mut $dst;
|
|
write!(dst, $($arg)*).and_then(|_| dst.flush())
|
|
}};
|
|
}
|