Skip to content

Commit 114175e

Browse files
authored
Merge pull request #255 from mkroening/println-update
refactor: Update print macros from kernel
2 parents c03ecd0 + 8749279 commit 114175e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/macros.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
/// Print formatted text to our console.
1+
/// Prints to the standard output.
22
///
3-
/// From http://blog.phil-opp.com/rust-os/printing-to-screen.html, but tweaked
4-
/// for HermitCore.
3+
/// Adapted from [`std::print`].
4+
///
5+
/// [`std::print`]: https://doc.rust-lang.org/stable/std/macro.print.html
56
#[macro_export]
67
macro_rules! print {
78
($($arg:tt)*) => {{
89
$crate::_print(::core::format_args!($($arg)*));
910
}};
1011
}
1112

12-
/// Print formatted text to our console, followed by a newline.
13+
/// Prints to the standard output, with a newline.
14+
///
15+
/// Adapted from [`std::println`].
16+
///
17+
/// [`std::println`]: https://doc.rust-lang.org/stable/std/macro.println.html
1318
#[macro_export]
1419
macro_rules! println {
1520
() => {
1621
$crate::print!("\n")
1722
};
1823
($($arg:tt)*) => {{
19-
print!("{}\n", ::core::format_args!($($arg)*))
24+
$crate::_print(::core::format_args!("{}\n", format_args!($($arg)*)));
2025
}};
2126
}
2227

0 commit comments

Comments
 (0)