]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/src/docs/write_with_newline.txt
New upstream version 1.66.0+dfsg1
[rustc.git] / src / tools / clippy / src / docs / write_with_newline.txt
CommitLineData
f2b60f7d
FG
1### What it does
2This lint warns when you use `write!()` with a format
3string that
4ends in a newline.
5
6### Why is this bad?
7You should use `writeln!()` instead, which appends the
8newline.
9
10### Example
11```
12write!(buf, "Hello {}!\n", name);
13```
14
15Use instead:
16```
17writeln!(buf, "Hello {}!", name);
18```