]> git.lizzy.rs Git - rust.git/blob - src/docs/unnecessary_owned_empty_strings.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / unnecessary_owned_empty_strings.txt
1 ### What it does
2
3 Detects cases of owned empty strings being passed as an argument to a function expecting `&str`
4
5 ### Why is this bad?
6
7 This results in longer and less readable code
8
9 ### Example
10 ```
11 vec!["1", "2", "3"].join(&String::new());
12 ```
13 Use instead:
14 ```
15 vec!["1", "2", "3"].join("");
16 ```