]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/write_with_newline.txt
Rollup merge of #101389 - lukaslueg:rcgetmutdocs, r=m-ou-se
[rust.git] / src / tools / clippy / src / docs / write_with_newline.txt
1 ### What it does
2 This lint warns when you use `write!()` with a format
3 string that
4 ends in a newline.
5
6 ### Why is this bad?
7 You should use `writeln!()` instead, which appends the
8 newline.
9
10 ### Example
11 ```
12 write!(buf, "Hello {}!\n", name);
13 ```
14
15 Use instead:
16 ```
17 writeln!(buf, "Hello {}!", name);
18 ```