]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/src/docs/write_literal.txt
New upstream version 1.66.0+dfsg1
[rustc.git] / src / tools / clippy / src / docs / write_literal.txt
CommitLineData
f2b60f7d
FG
1### What it does
2This lint warns about the use of literals as `write!`/`writeln!` args.
3
4### Why is this bad?
5Using 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
f2b60f7d
FG
9### Example
10```
11writeln!(buf, "{}", "foo");
12```
13
14Use instead:
15```
16writeln!(buf, "foo");
17```