mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-21 02:23:19 +00:00
6b6253016f
rustc now (https://github.com/rust-lang/rust/issues/33525) does not report an error count anymore, because it was not correct in many cases.
37 lines
1.4 KiB
Text
37 lines
1.4 KiB
Text
error: redundant pattern matching, consider using `is_ok()`
|
|
--> if_let_redundant_pattern_matching.rs:9:12
|
|
|
|
|
9 | if let Ok(_) = Ok::<i32, i32>(42) {}
|
|
| -------^^^^^--------------------- help: try this `if Ok::<i32, i32>(42).is_ok()`
|
|
|
|
|
= note: `-D if-let-redundant-pattern-matching` implied by `-D warnings`
|
|
|
|
error: redundant pattern matching, consider using `is_err()`
|
|
--> if_let_redundant_pattern_matching.rs:11:12
|
|
|
|
|
11 | if let Err(_) = Err::<i32, i32>(42) {
|
|
| -------^^^^^^---------------------- help: try this `if Err::<i32, i32>(42).is_err()`
|
|
|
|
|
= note: `-D if-let-redundant-pattern-matching` implied by `-D warnings`
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
|
--> if_let_redundant_pattern_matching.rs:14:12
|
|
|
|
|
14 | if let None = None::<()> {
|
|
| -------^^^^------------- help: try this `if None::<()>.is_none()`
|
|
|
|
|
= note: `-D if-let-redundant-pattern-matching` implied by `-D warnings`
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
|
--> if_let_redundant_pattern_matching.rs:17:12
|
|
|
|
|
17 | if let Some(_) = Some(42) {
|
|
| -------^^^^^^^----------- help: try this `if Some(42).is_some()`
|
|
|
|
|
= note: `-D if-let-redundant-pattern-matching` implied by `-D warnings`
|
|
|
|
error: aborting due to previous error(s)
|
|
|
|
error: Could not compile `clippy_tests`.
|
|
|
|
To learn more, run the command again with --verbose.
|