summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/write_with_newline.txt
blob: 22845fd6515bdb88841396bfbd64aa2a3b107c15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
### What it does
This lint warns when you use `write!()` with a format
string that
ends in a newline.

### Why is this bad?
You should use `writeln!()` instead, which appends the
newline.

### Example
```
write!(buf, "Hello {}!\n", name);
```

Use instead:
```
writeln!(buf, "Hello {}!", name);
```