]> git.lizzy.rs Git - rust.git/blob - tests/ui/redundant_pattern_matching.stderr
Merge pull request #3281 from CYBAI/redundant-match
[rust.git] / tests / ui / redundant_pattern_matching.stderr
1 error: redundant pattern matching, consider using `is_ok()`
2   --> $DIR/redundant_pattern_matching.rs:19:12
3    |
4 19 |     if let Ok(_) = Ok::<i32, i32>(42) {}
5    |     -------^^^^^------------------------ help: try this: `if Ok::<i32, i32>(42).is_ok()`
6    |
7    = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
8
9 error: redundant pattern matching, consider using `is_err()`
10   --> $DIR/redundant_pattern_matching.rs:21:12
11    |
12 21 |       if let Err(_) = Err::<i32, i32>(42) {
13    |  _____-      ^^^^^^
14 22 | |     }
15    | |_____- help: try this: `if Err::<i32, i32>(42).is_err()`
16
17 error: redundant pattern matching, consider using `is_none()`
18   --> $DIR/redundant_pattern_matching.rs:24:12
19    |
20 24 |       if let None = None::<()> {
21    |  _____-      ^^^^
22 25 | |     }
23    | |_____- help: try this: `if None::<()>.is_none()`
24
25 error: redundant pattern matching, consider using `is_some()`
26   --> $DIR/redundant_pattern_matching.rs:27:12
27    |
28 27 |       if let Some(_) = Some(42) {
29    |  _____-      ^^^^^^^
30 28 | |     }
31    | |_____- help: try this: `if Some(42).is_some()`
32
33 error: redundant pattern matching, consider using `is_ok()`
34   --> $DIR/redundant_pattern_matching.rs:46:5
35    |
36 46 | /     match Ok::<i32, i32>(42) {
37 47 | |         Ok(_) => true,
38 48 | |         Err(_) => false,
39 49 | |     };
40    | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
41
42 error: redundant pattern matching, consider using `is_err()`
43   --> $DIR/redundant_pattern_matching.rs:51:5
44    |
45 51 | /     match Ok::<i32, i32>(42) {
46 52 | |         Ok(_) => false,
47 53 | |         Err(_) => true,
48 54 | |     };
49    | |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
50
51 error: redundant pattern matching, consider using `is_err()`
52   --> $DIR/redundant_pattern_matching.rs:56:5
53    |
54 56 | /     match Err::<i32, i32>(42) {
55 57 | |         Ok(_) => false,
56 58 | |         Err(_) => true,
57 59 | |     };
58    | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
59
60 error: redundant pattern matching, consider using `is_ok()`
61   --> $DIR/redundant_pattern_matching.rs:61:5
62    |
63 61 | /     match Err::<i32, i32>(42) {
64 62 | |         Ok(_) => true,
65 63 | |         Err(_) => false,
66 64 | |     };
67    | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
68
69 error: redundant pattern matching, consider using `is_some()`
70   --> $DIR/redundant_pattern_matching.rs:66:5
71    |
72 66 | /     match Some(42) {
73 67 | |         Some(_) => true,
74 68 | |         None => false,
75 69 | |     };
76    | |_____^ help: try this: `Some(42).is_some()`
77
78 error: redundant pattern matching, consider using `is_none()`
79   --> $DIR/redundant_pattern_matching.rs:71:5
80    |
81 71 | /     match None::<()> {
82 72 | |         Some(_) => false,
83 73 | |         None => true,
84 74 | |     };
85    | |_____^ help: try this: `None::<()>.is_none()`
86
87 error: aborting due to 10 previous errors
88