summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/manual_str_repeat.txt
blob: 1d4a7a48e203345b96f0ae4db4e243542693f327 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
### What it does
Checks for manual implementations of `str::repeat`

### Why is this bad?
These are both harder to read, as well as less performant.

### Example
```
let x: String = std::iter::repeat('x').take(10).collect();
```

Use instead:
```
let x: String = "x".repeat(10);
```