Skip to content

Commit 79a8867

Browse files
committed
update test option
1 parent c53ceba commit 79a8867

3 files changed

+22
-24
lines changed

Diff for: tests/ui/redundant_pattern_matching_option.fixed

+2-3
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,14 @@ fn issue7921() {
9292

9393
fn issue10726() {
9494
let x = Some(42);
95-
let y = None::<()>;
9695

9796
x.is_some();
9897

9998
x.is_none();
10099

101-
y.is_some();
100+
x.is_none();
102101

103-
y.is_none();
102+
x.is_some();
104103

105104
// Don't lint
106105
match x {

Diff for: tests/ui/redundant_pattern_matching_option.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ fn issue7921() {
107107

108108
fn issue10726() {
109109
let x = Some(42);
110-
let y = None::<()>;
111110

112111
match x {
113112
Some(_) => true,
@@ -119,14 +118,14 @@ fn issue10726() {
119118
_ => false,
120119
};
121120

122-
match y {
123-
Some(_) => true,
124-
_ => false,
121+
match x {
122+
Some(_) => false,
123+
_ => true,
125124
};
126125

127-
match y {
128-
None => true,
129-
_ => false,
126+
match x {
127+
None => false,
128+
_ => true,
130129
};
131130

132131
// Don't lint

Diff for: tests/ui/redundant_pattern_matching_option.stderr

+14-14
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ LL | if let None = *&None::<()> {}
149149
| -------^^^^--------------- help: try this: `if (&None::<()>).is_none()`
150150

151151
error: redundant pattern matching, consider using `is_some()`
152-
--> $DIR/redundant_pattern_matching_option.rs:112:5
152+
--> $DIR/redundant_pattern_matching_option.rs:111:5
153153
|
154154
LL | / match x {
155155
LL | | Some(_) => true,
@@ -158,31 +158,31 @@ LL | | };
158158
| |_____^ help: try this: `x.is_some()`
159159

160160
error: redundant pattern matching, consider using `is_none()`
161-
--> $DIR/redundant_pattern_matching_option.rs:117:5
161+
--> $DIR/redundant_pattern_matching_option.rs:116:5
162162
|
163163
LL | / match x {
164164
LL | | None => true,
165165
LL | | _ => false,
166166
LL | | };
167167
| |_____^ help: try this: `x.is_none()`
168168

169-
error: redundant pattern matching, consider using `is_some()`
170-
--> $DIR/redundant_pattern_matching_option.rs:122:5
169+
error: redundant pattern matching, consider using `is_none()`
170+
--> $DIR/redundant_pattern_matching_option.rs:121:5
171171
|
172-
LL | / match y {
173-
LL | | Some(_) => true,
174-
LL | | _ => false,
172+
LL | / match x {
173+
LL | | Some(_) => false,
174+
LL | | _ => true,
175175
LL | | };
176-
| |_____^ help: try this: `y.is_some()`
176+
| |_____^ help: try this: `x.is_none()`
177177

178-
error: redundant pattern matching, consider using `is_none()`
179-
--> $DIR/redundant_pattern_matching_option.rs:127:5
178+
error: redundant pattern matching, consider using `is_some()`
179+
--> $DIR/redundant_pattern_matching_option.rs:126:5
180180
|
181-
LL | / match y {
182-
LL | | None => true,
183-
LL | | _ => false,
181+
LL | / match x {
182+
LL | | None => false,
183+
LL | | _ => true,
184184
LL | | };
185-
| |_____^ help: try this: `y.is_none()`
185+
| |_____^ help: try this: `x.is_some()`
186186

187187
error: aborting due to 26 previous errors
188188

0 commit comments

Comments
 (0)