mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
17 lines
743 B
Text
17 lines
743 B
Text
error: use of a fallible conversion when an infallible one could be used
|
|
--> $DIR/unnecessary_fallible_conversions.rs:4:23
|
|
|
|
|
LL | let _: i64 = 0i32.try_into().unwrap();
|
|
| ^^^^^^^^^^^^^^^^^^^ help: use: `into()`
|
|
|
|
|
= note: `-D clippy::unnecessary-fallible-conversions` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_fallible_conversions)]`
|
|
|
|
error: use of a fallible conversion when an infallible one could be used
|
|
--> $DIR/unnecessary_fallible_conversions.rs:5:23
|
|
|
|
|
LL | let _: i64 = 0i32.try_into().expect("can't happen");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `into()`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|