Use writeln!() rather than print!() + concat!() in println!()

This fixes using format arg captures
This commit is contained in:
bjorn3
2025-09-12 19:08:29 +02:00
parent b3522b19e6
commit fbbe24c82b
+4 -3
View File
@@ -10,7 +10,8 @@ macro_rules! print {
/// Print with new line to console
#[macro_export]
macro_rules! println {
() => (print!("\n"));
($fmt:expr_2021) => (print!(concat!($fmt, "\n")));
($fmt:expr_2021, $($arg:tt)*) => (print!(concat!($fmt, "\n"), $($arg)*));
($($arg:tt)*) => ({
use core::fmt::Write;
let _ = writeln!($crate::arch::debug::Writer::new(), $($arg)*);
});
}