]>
Commit | Line | Data |
---|---|---|
f2b60f7d FG |
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 | ``` |