1 error: useless conversion to the same type: `T`
2 --> $DIR/useless_conversion.rs:7:13
4 LL | let _ = T::from(val);
5 | ^^^^^^^^^^^^ help: consider removing `T::from()`: `val`
7 note: the lint level is defined here
8 --> $DIR/useless_conversion.rs:3:9
10 LL | #![deny(clippy::useless_conversion)]
11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
13 error: useless conversion to the same type: `T`
14 --> $DIR/useless_conversion.rs:8:5
17 | ^^^^^^^^^^ help: consider removing `.into()`: `val`
19 error: useless conversion to the same type: `i32`
20 --> $DIR/useless_conversion.rs:20:22
22 LL | let _: i32 = 0i32.into();
23 | ^^^^^^^^^^^ help: consider removing `.into()`: `0i32`
25 error: useless conversion to the same type: `std::str::Lines<'_>`
26 --> $DIR/useless_conversion.rs:45:22
28 LL | if Some("ok") == lines.into_iter().next() {}
29 | ^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `lines`
31 error: useless conversion to the same type: `std::str::Lines<'_>`
32 --> $DIR/useless_conversion.rs:50:21
34 LL | let mut lines = text.lines().into_iter();
35 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `text.lines()`
37 error: useless conversion to the same type: `std::str::Lines<'_>`
38 --> $DIR/useless_conversion.rs:56:22
40 LL | if Some("ok") == text.lines().into_iter().next() {}
41 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `text.lines()`
43 error: useless conversion to the same type: `std::ops::Range<i32>`
44 --> $DIR/useless_conversion.rs:62:13
46 LL | let _ = NUMBERS.into_iter().next();
47 | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `NUMBERS`
49 error: useless conversion to the same type: `std::ops::Range<i32>`
50 --> $DIR/useless_conversion.rs:67:17
52 LL | let mut n = NUMBERS.into_iter();
53 | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `NUMBERS`
55 error: useless conversion to the same type: `std::string::String`
56 --> $DIR/useless_conversion.rs:128:21
58 LL | let _: String = "foo".to_string().into();
59 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"foo".to_string()`
61 error: useless conversion to the same type: `std::string::String`
62 --> $DIR/useless_conversion.rs:129:21
64 LL | let _: String = From::from("foo".to_string());
65 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `From::from()`: `"foo".to_string()`
67 error: useless conversion to the same type: `std::string::String`
68 --> $DIR/useless_conversion.rs:130:13
70 LL | let _ = String::from("foo".to_string());
71 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `"foo".to_string()`
73 error: useless conversion to the same type: `std::string::String`
74 --> $DIR/useless_conversion.rs:131:13
76 LL | let _ = String::from(format!("A: {:04}", 123));
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("A: {:04}", 123)`
79 error: useless conversion to the same type: `std::str::Lines<'_>`
80 --> $DIR/useless_conversion.rs:132:13
82 LL | let _ = "".lines().into_iter();
83 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `"".lines()`
85 error: useless conversion to the same type: `std::vec::IntoIter<i32>`
86 --> $DIR/useless_conversion.rs:133:13
88 LL | let _ = vec![1, 2, 3].into_iter().into_iter();
89 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![1, 2, 3].into_iter()`
91 error: useless conversion to the same type: `std::string::String`
92 --> $DIR/useless_conversion.rs:134:21
94 LL | let _: String = format!("Hello {}", "world").into();
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `format!("Hello {}", "world")`
97 error: useless conversion to the same type: `i32`
98 --> $DIR/useless_conversion.rs:139:13
100 LL | let _ = i32::from(a + b) * 3;
101 | ^^^^^^^^^^^^^^^^ help: consider removing `i32::from()`: `(a + b)`
103 error: useless conversion to the same type: `Foo<'a'>`
104 --> $DIR/useless_conversion.rs:145:23
106 LL | let _: Foo<'a'> = s2.into();
107 | ^^^^^^^^^ help: consider removing `.into()`: `s2`
109 error: useless conversion to the same type: `Foo<'a'>`
110 --> $DIR/useless_conversion.rs:147:13
112 LL | let _ = Foo::<'a'>::from(s3);
113 | ^^^^^^^^^^^^^^^^^^^^ help: consider removing `Foo::<'a'>::from()`: `s3`
115 error: useless conversion to the same type: `std::vec::IntoIter<Foo<'a'>>`
116 --> $DIR/useless_conversion.rs:149:13
118 LL | let _ = vec![s4, s4, s4].into_iter().into_iter();
119 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![s4, s4, s4].into_iter()`
121 error: aborting due to 19 previous errors