mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-30 06:53:27 +00:00
79 lines
2.6 KiB
Text
79 lines
2.6 KiB
Text
error: useless conversion to the same type: `T`
|
|
--> $DIR/useless_conversion_try.rs:5:13
|
|
|
|
|
LL | let _ = T::try_from(val).unwrap();
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider removing `T::try_from()`
|
|
note: the lint level is defined here
|
|
--> $DIR/useless_conversion_try.rs:1:9
|
|
|
|
|
LL | #![deny(clippy::useless_conversion)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: useless conversion to the same type: `T`
|
|
--> $DIR/useless_conversion_try.rs:6:5
|
|
|
|
|
LL | val.try_into().unwrap()
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider removing `.try_into()`
|
|
|
|
error: useless conversion to the same type: `std::string::String`
|
|
--> $DIR/useless_conversion_try.rs:28:21
|
|
|
|
|
LL | let _: String = "foo".to_string().try_into().unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider removing `.try_into()`
|
|
|
|
error: useless conversion to the same type: `std::string::String`
|
|
--> $DIR/useless_conversion_try.rs:29:21
|
|
|
|
|
LL | let _: String = TryFrom::try_from("foo".to_string()).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider removing `TryFrom::try_from()`
|
|
|
|
error: useless conversion to the same type: `std::string::String`
|
|
--> $DIR/useless_conversion_try.rs:30:13
|
|
|
|
|
LL | let _ = String::try_from("foo".to_string()).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider removing `String::try_from()`
|
|
|
|
error: useless conversion to the same type: `std::string::String`
|
|
--> $DIR/useless_conversion_try.rs:31:13
|
|
|
|
|
LL | let _ = String::try_from(format!("A: {:04}", 123)).unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider removing `String::try_from()`
|
|
|
|
error: useless conversion to the same type: `std::string::String`
|
|
--> $DIR/useless_conversion_try.rs:32:21
|
|
|
|
|
LL | let _: String = format!("Hello {}", "world").try_into().unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider removing `.try_into()`
|
|
|
|
error: useless conversion to the same type: `std::string::String`
|
|
--> $DIR/useless_conversion_try.rs:33:21
|
|
|
|
|
LL | let _: String = String::new().try_into().unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider removing `.try_into()`
|
|
|
|
error: useless conversion to the same type: `std::string::String`
|
|
--> $DIR/useless_conversion_try.rs:34:27
|
|
|
|
|
LL | let _: String = match String::from("_").try_into() {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: consider removing `.try_into()`
|
|
|
|
error: aborting due to 9 previous errors
|
|
|