]> git.lizzy.rs Git - rust.git/blob - tests/ui/string_add.rs
Auto merge of #4568 - mikerite:fix-4548, r=flip1995
[rust.git] / tests / ui / string_add.rs
1 #[warn(clippy::string_add)]
2 #[allow(clippy::string_add_assign, unused)]
3 fn main() {
4     // ignores assignment distinction
5     let mut x = "".to_owned();
6
7     for _ in 1..3 {
8         x = x + ".";
9     }
10
11     let y = "".to_owned();
12     let z = y + "...";
13
14     assert_eq!(&x, &z);
15
16     let mut x = 1;
17     x = x + 1;
18     assert_eq!(2, x);
19 }