]> git.lizzy.rs Git - rust.git/blob - tests/ui/string_add_assign.fixed
Merge commit '7ea7cd165ad6705603852771bf82cc2fd6560db5' into clippyup2
[rust.git] / tests / ui / string_add_assign.fixed
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 += ".";
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 += 1;
20     assert_eq!(2, x);
21 }