print!
macro with newline RS-C1005Several macros in the standard library such as print!
and eprint!
have
analogous macros such as println!
and eprintln!
that append a newline. Instead of
calling print!
with an explicit newline character at the end of the format string,
prefer its alternative, println!
.
Remove the trailing newline character from the original format string and replace the macro call with its analog:
print!
with println!
eprint!
with eprintln!
write!
with writeln!
print!("Hello, World!\n");
println!("Hello, World!");