Daily Rust newline fix
Published 330d ago
ayebear
A macro wrapper around println that has working newlines. Please fix this issue properly @dailyrust-devs
// Newline hack for dailyrust
macro_rules! daily {
($($arg:tt)*) => {
println!("{: <120}", format!($($arg)*));
};
}
fn main() {
daily!("Hello world!");
daily!("Hello world!");
daily!("Hello world!");
for i in 0..100 {
let s = std::iter::repeat("#").take(i).collect::<String>();
daily!("{s}");
}
}
newlines
Please login or sign up to comment and collaborate