2020-09-24 07:49:22 -05:00
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:14:5
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
LL | matches!(maybe_some, None if !boolean)
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `maybe_some.is_none() && (!boolean)`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::redundant-pattern-matching` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::redundant_pattern_matching)]`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:18:13
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | let _ = matches!(maybe_some, None if boolean || boolean2); // guard needs parentheses
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `maybe_some.is_none() && (boolean || boolean2)`
|
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:27:12
|
2023-07-31 16:53:53 -05:00
|
|
|
|
|
|
|
|
LL | if let None = None::<()> {}
|
|
|
|
| -------^^^^------------- help: try: `if None::<()>.is_none()`
|
|
|
|
|
2020-09-24 07:49:22 -05:00
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:29:12
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | if let Some(_) = Some(42) {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:31:12
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | if let Some(_) = Some(42) {
|
2023-07-17 03:19:29 -05:00
|
|
|
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:37:15
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | while let Some(_) = Some(42) {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| ----------^^^^^^^----------- help: try: `while Some(42).is_some()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:39:15
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | while let None = Some(42) {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| ----------^^^^----------- help: try: `while Some(42).is_none()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:41:15
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | while let None = None::<()> {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| ----------^^^^------------- help: try: `while None::<()>.is_none()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:44:15
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | while let Some(_) = v.pop() {
|
2023-07-17 03:19:29 -05:00
|
|
|
| ----------^^^^^^^---------- help: try: `while v.pop().is_some()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:52:5
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | / match Some(42) {
|
|
|
|
LL | | Some(_) => true,
|
|
|
|
LL | | None => false,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `Some(42).is_some()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:57:5
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | / match None::<()> {
|
|
|
|
LL | | Some(_) => false,
|
|
|
|
LL | | None => true,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `None::<()>.is_none()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:62:13
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | let _ = match None::<()> {
|
|
|
|
| _____________^
|
|
|
|
LL | | Some(_) => false,
|
|
|
|
LL | | None => true,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `None::<()>.is_none()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:68:20
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
2020-12-06 08:01:03 -06:00
|
|
|
LL | let _ = if let Some(_) = opt { true } else { false };
|
2023-07-17 03:19:29 -05:00
|
|
|
| -------^^^^^^^------ help: try: `if opt.is_some()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:74:20
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | let _ = if let Some(_) = gen_opt() {
|
2023-07-17 03:19:29 -05:00
|
|
|
| -------^^^^^^^------------ help: try: `if gen_opt().is_some()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:76:19
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | } else if let None = gen_opt() {
|
2023-07-17 03:19:29 -05:00
|
|
|
| -------^^^^------------ help: try: `if gen_opt().is_none()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:82:12
|
2023-05-05 10:45:49 -05:00
|
|
|
|
|
|
|
|
LL | if let Some(..) = gen_opt() {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| -------^^^^^^^^------------ help: try: `if gen_opt().is_some()`
|
2023-05-05 10:45:49 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:97:12
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | if let Some(_) = Some(42) {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| -------^^^^^^^----------- help: try: `if Some(42).is_some()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:99:12
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | if let None = None::<()> {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| -------^^^^------------- help: try: `if None::<()>.is_none()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:101:15
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | while let Some(_) = Some(42) {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| ----------^^^^^^^----------- help: try: `while Some(42).is_some()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:103:15
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | while let None = None::<()> {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| ----------^^^^------------- help: try: `while None::<()>.is_none()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:105:5
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | / match Some(42) {
|
|
|
|
LL | | Some(_) => true,
|
|
|
|
LL | | None => false,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `Some(42).is_some()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:110:5
|
2020-09-24 07:49:22 -05:00
|
|
|
|
|
|
|
|
LL | / match None::<()> {
|
|
|
|
LL | | Some(_) => false,
|
|
|
|
LL | | None => true,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `None::<()>.is_none()`
|
2020-09-24 07:49:22 -05:00
|
|
|
|
2021-12-06 05:33:31 -06:00
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:118:12
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | if let None = *(&None::<()>) {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| -------^^^^----------------- help: try: `if (&None::<()>).is_none()`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:119:12
|
2021-12-06 05:33:31 -06:00
|
|
|
|
|
|
|
|
LL | if let None = *&None::<()> {}
|
2023-07-17 03:19:29 -05:00
|
|
|
| -------^^^^--------------- help: try: `if (&None::<()>).is_none()`
|
2021-12-06 05:33:31 -06:00
|
|
|
|
2023-05-20 08:39:26 -05:00
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:125:5
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
|
|
|
LL | / match x {
|
|
|
|
LL | | Some(_) => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `x.is_some()`
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:130:5
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
|
|
|
LL | / match x {
|
|
|
|
LL | | None => true,
|
|
|
|
LL | | _ => false,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `x.is_none()`
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:135:5
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
|
|
|
LL | / match x {
|
|
|
|
LL | | Some(_) => false,
|
|
|
|
LL | | _ => true,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `x.is_none()`
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:140:5
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
|
|
|
LL | / match x {
|
|
|
|
LL | | None => false,
|
|
|
|
LL | | _ => true,
|
|
|
|
LL | | };
|
2023-07-17 03:19:29 -05:00
|
|
|
| |_____^ help: try: `x.is_some()`
|
2023-05-20 08:39:26 -05:00
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
error: redundant pattern matching, consider using `is_some()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:155:13
|
2023-06-02 04:41:57 -05:00
|
|
|
|
|
|
|
|
LL | let _ = matches!(x, Some(_));
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `x.is_some()`
|
2023-06-02 04:41:57 -05:00
|
|
|
|
|
|
|
error: redundant pattern matching, consider using `is_none()`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/redundant_pattern_matching_option.rs:157:13
|
2023-06-02 04:41:57 -05:00
|
|
|
|
|
|
|
|
LL | let _ = matches!(x, None);
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `x.is_none()`
|
2023-06-02 04:41:57 -05:00
|
|
|
|
2023-07-31 16:53:53 -05:00
|
|
|
error: aborting due to 30 previous errors
|
2020-09-24 07:49:22 -05:00
|
|
|
|