]> git.lizzy.rs Git - rust.git/blob - src/docs/print_with_newline.txt
[Arithmetic] Consider literals
[rust.git] / src / docs / print_with_newline.txt
1 ### What it does
2 This lint warns when you use `print!()` with a format
3 string that ends in a newline.
4
5 ### Why is this bad?
6 You should use `println!()` instead, which appends the
7 newline.
8
9 ### Example
10 ```
11 print!("Hello {}!\n", name);
12 ```
13 use println!() instead
14 ```
15 println!("Hello {}!", name);
16 ```