mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-18 18:58:45 +00:00
134 lines
4.8 KiB
Text
134 lines
4.8 KiB
Text
error: redundant pattern matching, consider using `is_none()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:8:12
|
|
|
|
|
LL | if let None = None::<()> {}
|
|
| -------^^^^------------- help: try this: `if None::<()>.is_none()`
|
|
|
|
|
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:10:12
|
|
|
|
|
LL | if let Some(_) = Some(42) {}
|
|
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:12:12
|
|
|
|
|
LL | if let Some(_) = Some(42) {
|
|
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:18:15
|
|
|
|
|
LL | while let Some(_) = Some(42) {}
|
|
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:20:15
|
|
|
|
|
LL | while let None = Some(42) {}
|
|
| ----------^^^^----------- help: try this: `while Some(42).is_none()`
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:22:15
|
|
|
|
|
LL | while let None = None::<()> {}
|
|
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:25:15
|
|
|
|
|
LL | while let Some(_) = v.pop() {
|
|
| ----------^^^^^^^---------- help: try this: `while v.pop().is_some()`
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:33:5
|
|
|
|
|
LL | / match Some(42) {
|
|
LL | | Some(_) => true,
|
|
LL | | None => false,
|
|
LL | | };
|
|
| |_____^ help: try this: `Some(42).is_some()`
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:38:5
|
|
|
|
|
LL | / match None::<()> {
|
|
LL | | Some(_) => false,
|
|
LL | | None => true,
|
|
LL | | };
|
|
| |_____^ help: try this: `None::<()>.is_none()`
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:43:13
|
|
|
|
|
LL | let _ = match None::<()> {
|
|
| _____________^
|
|
LL | | Some(_) => false,
|
|
LL | | None => true,
|
|
LL | | };
|
|
| |_____^ help: try this: `None::<()>.is_none()`
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:49:20
|
|
|
|
|
LL | let _ = if let Some(_) = opt { true } else { false };
|
|
| -------^^^^^^^------ help: try this: `if opt.is_some()`
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:53:20
|
|
|
|
|
LL | let _ = if let Some(_) = gen_opt() {
|
|
| -------^^^^^^^------------ help: try this: `if gen_opt().is_some()`
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:55:19
|
|
|
|
|
LL | } else if let None = gen_opt() {
|
|
| -------^^^^------------ help: try this: `if gen_opt().is_none()`
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:74:12
|
|
|
|
|
LL | if let Some(_) = Some(42) {}
|
|
| -------^^^^^^^----------- help: try this: `if Some(42).is_some()`
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:76:12
|
|
|
|
|
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:78:15
|
|
|
|
|
LL | while let Some(_) = Some(42) {}
|
|
| ----------^^^^^^^----------- help: try this: `while Some(42).is_some()`
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:80:15
|
|
|
|
|
LL | while let None = None::<()> {}
|
|
| ----------^^^^------------- help: try this: `while None::<()>.is_none()`
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:82:5
|
|
|
|
|
LL | / match Some(42) {
|
|
LL | | Some(_) => true,
|
|
LL | | None => false,
|
|
LL | | };
|
|
| |_____^ help: try this: `Some(42).is_some()`
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
|
--> $DIR/redundant_pattern_matching_option.rs:87:5
|
|
|
|
|
LL | / match None::<()> {
|
|
LL | | Some(_) => false,
|
|
LL | | None => true,
|
|
LL | | };
|
|
| |_____^ help: try this: `None::<()>.is_none()`
|
|
|
|
error: aborting due to 19 previous errors
|
|
|