diff options
Diffstat (limited to 'src/tools/clippy/tests/ui/redundant_pattern_matching_result.fixed')
-rw-r--r-- | src/tools/clippy/tests/ui/redundant_pattern_matching_result.fixed | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/redundant_pattern_matching_result.fixed b/src/tools/clippy/tests/ui/redundant_pattern_matching_result.fixed index e4032ae44..343e0d043 100644 --- a/src/tools/clippy/tests/ui/redundant_pattern_matching_result.fixed +++ b/src/tools/clippy/tests/ui/redundant_pattern_matching_result.fixed @@ -6,6 +6,7 @@ clippy::if_same_then_else, clippy::match_like_matches_macro, clippy::needless_bool, + clippy::needless_if, clippy::uninlined_format_args, clippy::unnecessary_wraps )] @@ -44,6 +45,7 @@ fn main() { issue6067(); issue6065(); issue10726(); + issue10803(); let _ = if gen_res().is_ok() { 1 @@ -133,3 +135,17 @@ fn issue10726() { _ => true, }; } + +fn issue10803() { + let x: Result<i32, i32> = Ok(42); + + let _ = x.is_ok(); + + let _ = x.is_err(); + + // Don't lint + let _ = matches!(x, Ok(16)); + + // Don't lint + let _ = matches!(x, Err(16)); +} |