2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `T`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/useless_conversion_try.rs:5:13
|
2020-05-28 13:45:24 +00:00
|
|
|
|
|
|
|
|
LL | let _ = T::try_from(val).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2022-09-22 16:04:22 +00:00
|
|
|
= help: consider removing `T::try_from()`
|
2020-05-28 13:45:24 +00:00
|
|
|
note: the lint level is defined here
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/useless_conversion_try.rs:1:9
|
2020-05-28 13:45:24 +00:00
|
|
|
|
|
|
|
|
LL | #![deny(clippy::useless_conversion)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `T`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/useless_conversion_try.rs:7:5
|
2020-05-28 13:45:24 +00:00
|
|
|
|
|
|
|
|
LL | val.try_into().unwrap()
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider removing `.try_into()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/useless_conversion_try.rs:30:21
|
2020-05-28 13:45:24 +00:00
|
|
|
|
|
|
|
|
LL | let _: String = "foo".to_string().try_into().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider removing `.try_into()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/useless_conversion_try.rs:32:21
|
2020-05-28 13:45:24 +00:00
|
|
|
|
|
|
|
|
LL | let _: String = TryFrom::try_from("foo".to_string()).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider removing `TryFrom::try_from()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/useless_conversion_try.rs:34:13
|
2020-05-28 13:45:24 +00:00
|
|
|
|
|
|
|
|
LL | let _ = String::try_from("foo".to_string()).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider removing `String::try_from()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/useless_conversion_try.rs:36:13
|
2020-05-28 13:45:24 +00:00
|
|
|
|
|
|
|
|
LL | let _ = String::try_from(format!("A: {:04}", 123)).unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider removing `String::try_from()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/useless_conversion_try.rs:38:21
|
2020-05-28 13:45:24 +00:00
|
|
|
|
|
|
|
|
LL | let _: String = format!("Hello {}", "world").try_into().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider removing `.try_into()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/useless_conversion_try.rs:40:21
|
2020-05-28 13:45:24 +00:00
|
|
|
|
|
2022-08-31 13:24:45 +00:00
|
|
|
LL | let _: String = String::new().try_into().unwrap();
|
2020-05-28 13:45:24 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider removing `.try_into()`
|
|
|
|
|
2020-09-24 12:49:22 +00:00
|
|
|
error: useless conversion to the same type: `std::string::String`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/useless_conversion_try.rs:42:27
|
2020-05-28 13:45:24 +00:00
|
|
|
|
|
|
|
|
LL | let _: String = match String::from("_").try_into() {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: consider removing `.try_into()`
|
|
|
|
|
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
|