]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/string_add_assign.rs
Rollup merge of #84221 - ABouttefeux:generic-arg-elision, r=estebank
[rust.git] / src / tools / clippy / tests / ui / string_add_assign.rs
1 // run-rustfix
2
3 #[allow(clippy::string_add, unused)]
4 #[warn(clippy::string_add_assign)]
5 fn main() {
6     // ignores assignment distinction
7     let mut x = "".to_owned();
8
9     for _ in 1..3 {
10         x = x + ".";
11     }
12
13     let y = "".to_owned();
14     let z = y + "...";
15
16     assert_eq!(&x, &z);
17
18     let mut x = 1;
19     x = x + 1;
20     assert_eq!(2, x);
21 }