]> git.lizzy.rs Git - rust.git/blob - src/docs/print_literal.txt
Auto merge of #9475 - Nemo157:mod-files-remap, r=xFrednet
[rust.git] / src / docs / print_literal.txt
1 ### What it does
2 This lint warns about the use of literals as `print!`/`println!` args.
3
4 ### Why is this bad?
5 Using literals as `println!` 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 println!("{}", "foo");
12 ```
13 use the literal without formatting:
14 ```
15 println!("foo");
16 ```