]> git.lizzy.rs Git - rust.git/blob - src/docs/string_add_assign.txt
Add iter_kv_map lint
[rust.git] / src / docs / string_add_assign.txt
1 ### What it does
2 Checks for string appends of the form `x = x + y` (without
3 `let`!).
4
5 ### Why is this bad?
6 It's not really bad, but some people think that the
7 `.push_str(_)` method is more readable.
8
9 ### Example
10 ```
11 let mut x = "Hello".to_owned();
12 x = x + ", World";
13
14 // More readable
15 x += ", World";
16 x.push_str(", World");
17 ```