]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/redundant_pattern_matching.stderr
Merge commit 'e636b88aa180e8cab9e28802aac90adbc984234d' into clippyup
[rust.git] / src / tools / clippy / tests / ui / redundant_pattern_matching.stderr
1 error: redundant pattern matching, consider using `is_ok()`
2   --> $DIR/redundant_pattern_matching.rs:15:12
3    |
4 LL |     if let Ok(_) = &result {}
5    |     -------^^^^^---------- help: try this: `if result.is_ok()`
6    |
7    = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
8
9 error: redundant pattern matching, consider using `is_ok()`
10   --> $DIR/redundant_pattern_matching.rs:17:12
11    |
12 LL |     if let Ok(_) = Ok::<i32, i32>(42) {}
13    |     -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
14
15 error: redundant pattern matching, consider using `is_err()`
16   --> $DIR/redundant_pattern_matching.rs:19:12
17    |
18 LL |     if let Err(_) = Err::<i32, i32>(42) {}
19    |     -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
20
21 error: redundant pattern matching, consider using `is_ok()`
22   --> $DIR/redundant_pattern_matching.rs:21:15
23    |
24 LL |     while let Ok(_) = Ok::<i32, i32>(10) {}
25    |     ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
26
27 error: redundant pattern matching, consider using `is_err()`
28   --> $DIR/redundant_pattern_matching.rs:23:15
29    |
30 LL |     while let Err(_) = Ok::<i32, i32>(10) {}
31    |     ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
32
33 error: redundant pattern matching, consider using `is_ok()`
34   --> $DIR/redundant_pattern_matching.rs:33:5
35    |
36 LL | /     match Ok::<i32, i32>(42) {
37 LL | |         Ok(_) => true,
38 LL | |         Err(_) => false,
39 LL | |     };
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:38:5
44    |
45 LL | /     match Ok::<i32, i32>(42) {
46 LL | |         Ok(_) => false,
47 LL | |         Err(_) => true,
48 LL | |     };
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:43:5
53    |
54 LL | /     match Err::<i32, i32>(42) {
55 LL | |         Ok(_) => false,
56 LL | |         Err(_) => true,
57 LL | |     };
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:48:5
62    |
63 LL | /     match Err::<i32, i32>(42) {
64 LL | |         Ok(_) => true,
65 LL | |         Err(_) => false,
66 LL | |     };
67    | |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
68
69 error: redundant pattern matching, consider using `is_ok()`
70   --> $DIR/redundant_pattern_matching.rs:53:20
71    |
72 LL |     let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
73    |             -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
74
75 error: redundant pattern matching, consider using `is_ok()`
76   --> $DIR/redundant_pattern_matching.rs:59:20
77    |
78 LL |     let _ = if let Ok(_) = gen_res() {
79    |             -------^^^^^------------ help: try this: `if gen_res().is_ok()`
80
81 error: redundant pattern matching, consider using `is_err()`
82   --> $DIR/redundant_pattern_matching.rs:61:19
83    |
84 LL |     } else if let Err(_) = gen_res() {
85    |            -------^^^^^^------------ help: try this: `if gen_res().is_err()`
86
87 error: redundant pattern matching, consider using `is_some()`
88   --> $DIR/redundant_pattern_matching.rs:84:19
89    |
90 LL |         while let Some(_) = r#try!(result_opt()) {}
91    |         ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
92
93 error: redundant pattern matching, consider using `is_some()`
94   --> $DIR/redundant_pattern_matching.rs:85:16
95    |
96 LL |         if let Some(_) = r#try!(result_opt()) {}
97    |         -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
98
99 error: redundant pattern matching, consider using `is_some()`
100   --> $DIR/redundant_pattern_matching.rs:91:12
101    |
102 LL |     if let Some(_) = m!() {}
103    |     -------^^^^^^^------- help: try this: `if m!().is_some()`
104
105 error: redundant pattern matching, consider using `is_some()`
106   --> $DIR/redundant_pattern_matching.rs:92:15
107    |
108 LL |     while let Some(_) = m!() {}
109    |     ----------^^^^^^^------- help: try this: `while m!().is_some()`
110
111 error: redundant pattern matching, consider using `is_ok()`
112   --> $DIR/redundant_pattern_matching.rs:110:12
113    |
114 LL |     if let Ok(_) = Ok::<i32, i32>(42) {}
115    |     -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
116
117 error: redundant pattern matching, consider using `is_err()`
118   --> $DIR/redundant_pattern_matching.rs:112:12
119    |
120 LL |     if let Err(_) = Err::<i32, i32>(42) {}
121    |     -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
122
123 error: redundant pattern matching, consider using `is_ok()`
124   --> $DIR/redundant_pattern_matching.rs:114:15
125    |
126 LL |     while let Ok(_) = Ok::<i32, i32>(10) {}
127    |     ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
128
129 error: redundant pattern matching, consider using `is_err()`
130   --> $DIR/redundant_pattern_matching.rs:116:15
131    |
132 LL |     while let Err(_) = Ok::<i32, i32>(10) {}
133    |     ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
134
135 error: redundant pattern matching, consider using `is_ok()`
136   --> $DIR/redundant_pattern_matching.rs:118:5
137    |
138 LL | /     match Ok::<i32, i32>(42) {
139 LL | |         Ok(_) => true,
140 LL | |         Err(_) => false,
141 LL | |     };
142    | |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
143
144 error: redundant pattern matching, consider using `is_err()`
145   --> $DIR/redundant_pattern_matching.rs:123:5
146    |
147 LL | /     match Err::<i32, i32>(42) {
148 LL | |         Ok(_) => false,
149 LL | |         Err(_) => true,
150 LL | |     };
151    | |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
152
153 error: aborting due to 22 previous errors
154