mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
update test option
This commit is contained in:
parent
c53ceba56f
commit
79a8867add
3 changed files with 24 additions and 26 deletions
|
@ -92,15 +92,14 @@ fn issue7921() {
|
|||
|
||||
fn issue10726() {
|
||||
let x = Some(42);
|
||||
let y = None::<()>;
|
||||
|
||||
x.is_some();
|
||||
|
||||
x.is_none();
|
||||
|
||||
y.is_some();
|
||||
x.is_none();
|
||||
|
||||
y.is_none();
|
||||
x.is_some();
|
||||
|
||||
// Don't lint
|
||||
match x {
|
||||
|
|
|
@ -107,7 +107,6 @@ fn issue7921() {
|
|||
|
||||
fn issue10726() {
|
||||
let x = Some(42);
|
||||
let y = None::<()>;
|
||||
|
||||
match x {
|
||||
Some(_) => true,
|
||||
|
@ -119,14 +118,14 @@ fn issue10726() {
|
|||
_ => false,
|
||||
};
|
||||
|
||||
match y {
|
||||
Some(_) => true,
|
||||
_ => false,
|
||||
match x {
|
||||
Some(_) => false,
|
||||
_ => true,
|
||||
};
|
||||
|
||||
match y {
|
||||
None => true,
|
||||
_ => false,
|
||||
match x {
|
||||
None => false,
|
||||
_ => true,
|
||||
};
|
||||
|
||||
// Don't lint
|
||||
|
|
|
@ -149,7 +149,7 @@ LL | if let None = *&None::<()> {}
|
|||
| -------^^^^--------------- help: try this: `if (&None::<()>).is_none()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_some()`
|
||||
--> $DIR/redundant_pattern_matching_option.rs:112:5
|
||||
--> $DIR/redundant_pattern_matching_option.rs:111:5
|
||||
|
|
||||
LL | / match x {
|
||||
LL | | Some(_) => true,
|
||||
|
@ -158,7 +158,7 @@ LL | | };
|
|||
| |_____^ help: try this: `x.is_some()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_none()`
|
||||
--> $DIR/redundant_pattern_matching_option.rs:117:5
|
||||
--> $DIR/redundant_pattern_matching_option.rs:116:5
|
||||
|
|
||||
LL | / match x {
|
||||
LL | | None => true,
|
||||
|
@ -166,23 +166,23 @@ LL | | _ => false,
|
|||
LL | | };
|
||||
| |_____^ help: try this: `x.is_none()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_some()`
|
||||
--> $DIR/redundant_pattern_matching_option.rs:122:5
|
||||
|
|
||||
LL | / match y {
|
||||
LL | | Some(_) => true,
|
||||
LL | | _ => false,
|
||||
LL | | };
|
||||
| |_____^ help: try this: `y.is_some()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_none()`
|
||||
--> $DIR/redundant_pattern_matching_option.rs:127:5
|
||||
--> $DIR/redundant_pattern_matching_option.rs:121:5
|
||||
|
|
||||
LL | / match y {
|
||||
LL | | None => true,
|
||||
LL | | _ => false,
|
||||
LL | / match x {
|
||||
LL | | Some(_) => false,
|
||||
LL | | _ => true,
|
||||
LL | | };
|
||||
| |_____^ help: try this: `y.is_none()`
|
||||
| |_____^ help: try this: `x.is_none()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_some()`
|
||||
--> $DIR/redundant_pattern_matching_option.rs:126:5
|
||||
|
|
||||
LL | / match x {
|
||||
LL | | None => false,
|
||||
LL | | _ => true,
|
||||
LL | | };
|
||||
| |_____^ help: try this: `x.is_some()`
|
||||
|
||||
error: aborting due to 26 previous errors
|
||||
|
||||
|
|
Loading…
Reference in a new issue