summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/positional_named_format_parameters.txt
blob: e391d2406677d5bd66cd6fec02ae92ed85a634e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
### What it does
This lint warns when a named parameter in a format string is used as a positional one.

### Why is this bad?
It may be confused for an assignment and obfuscates which parameter is being used.

### Example
```
println!("{}", x = 10);
```

Use instead:
```
println!("{x}", x = 10);
```