axstd/macros.rs
1//! Standard library macros
2
3/// Prints to the standard output.
4///
5/// Equivalent to the [`println!`] macro except that a newline is not printed at
6/// the end of the message.
7///
8/// [`println!`]: crate::println
9#[macro_export]
10macro_rules! print {
11 ($($arg:tt)*) => {
12 $crate::io::__print_impl(format_args!($($arg)*));
13 }
14}
15
16/// Prints to the standard output, with a newline.
17#[macro_export]
18macro_rules! println {
19 () => { $crate::print!("\n") };
20 ($($arg:tt)*) => {
21 $crate::io::__print_impl(format_args!("{}\n", format_args!($($arg)*)));
22 }
23}