summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/single_char_pattern.txt
blob: 9e5ad1e7d6395a9726543b6ad15f33536b2e5753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
### What it does
Checks for string methods that receive a single-character
`str` as an argument, e.g., `_.split("x")`.

### Why is this bad?
Performing these methods using a `char` is faster than
using a `str`.

### Known problems
Does not catch multi-byte unicode characters.

### Example
```
_.split("x");
```

Use instead:
```
_.split('x');
```