]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/write_literal.txt
Auto merge of #104673 - matthiaskrgr:rollup-85f65ov, r=matthiaskrgr
[rust.git] / src / tools / clippy / src / docs / write_literal.txt
1 ### What it does
2 This lint warns about the use of literals as `write!`/`writeln!` args.
3
4 ### Why is this bad?
5 Using literals as `writeln!` args is inefficient
6 (c.f., https://github.com/matthiaskrgr/rust-str-bench) and unnecessary
7 (i.e., just put the literal in the format string)
8
9 ### Example
10 ```
11 writeln!(buf, "{}", "foo");
12 ```
13
14 Use instead:
15 ```
16 writeln!(buf, "foo");
17 ```