]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/single_char_pattern.txt
Auto merge of #104673 - matthiaskrgr:rollup-85f65ov, r=matthiaskrgr
[rust.git] / src / tools / clippy / src / docs / single_char_pattern.txt
1 ### What it does
2 Checks for string methods that receive a single-character
3 `str` as an argument, e.g., `_.split("x")`.
4
5 ### Why is this bad?
6 Performing these methods using a `char` is faster than
7 using a `str`.
8
9 ### Known problems
10 Does not catch multi-byte unicode characters.
11
12 ### Example
13 ```
14 _.split("x");
15 ```
16
17 Use instead:
18 ```
19 _.split('x');
20 ```