| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:11:5 |
| | |
| LL | matches!(maybe_some, None if !boolean) |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| | |
| = note: `-D clippy::redundant-pattern-matching` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::redundant_pattern_matching)]` |
| help: consider using `is_none()` |
| | |
| LL - matches!(maybe_some, None if !boolean) |
| LL + maybe_some.is_none() && (!boolean) |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:16:13 |
| | |
| LL | let _ = matches!(maybe_some, None if boolean || boolean2); // guard needs parentheses |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - let _ = matches!(maybe_some, None if boolean || boolean2); // guard needs parentheses |
| LL + let _ = maybe_some.is_none() && (boolean || boolean2); // guard needs parentheses |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:32:12 |
| | |
| LL | if let None = None::<()> {} |
| | ^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - if let None = None::<()> {} |
| LL + if None::<()>.is_none() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:35:12 |
| | |
| LL | if let Some(_) = Some(42) {} |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - if let Some(_) = Some(42) {} |
| LL + if Some(42).is_some() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:38:12 |
| | |
| LL | if let Some(_) = Some(42) { |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - if let Some(_) = Some(42) { |
| LL + if Some(42).is_some() { |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:45:15 |
| | |
| LL | while let Some(_) = Some(42) {} |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - while let Some(_) = Some(42) {} |
| LL + while Some(42).is_some() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:48:15 |
| | |
| LL | while let None = Some(42) {} |
| | ^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - while let None = Some(42) {} |
| LL + while Some(42).is_none() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:51:15 |
| | |
| LL | while let None = None::<()> {} |
| | ^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - while let None = None::<()> {} |
| LL + while None::<()>.is_none() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:55:15 |
| | |
| LL | while let Some(_) = v.pop() { |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - while let Some(_) = v.pop() { |
| LL + while v.pop().is_some() { |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:64:5 |
| | |
| LL | / match Some(42) { |
| LL | | |
| LL | | Some(_) => true, |
| LL | | None => false, |
| LL | | }; |
| | |_____^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - match Some(42) { |
| LL - |
| LL - Some(_) => true, |
| LL - None => false, |
| LL - }; |
| LL + Some(42).is_some(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:70:5 |
| | |
| LL | / match None::<()> { |
| LL | | |
| LL | | Some(_) => false, |
| LL | | None => true, |
| LL | | }; |
| | |_____^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - match None::<()> { |
| LL - |
| LL - Some(_) => false, |
| LL - None => true, |
| LL - }; |
| LL + None::<()>.is_none(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:76:13 |
| | |
| LL | let _ = match None::<()> { |
| | _____________^ |
| LL | | |
| LL | | Some(_) => false, |
| LL | | None => true, |
| LL | | }; |
| | |_____^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - let _ = match None::<()> { |
| LL - |
| LL - Some(_) => false, |
| LL - None => true, |
| LL - }; |
| LL + let _ = None::<()>.is_none(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:83:20 |
| | |
| LL | let _ = if let Some(_) = opt { true } else { false }; |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - let _ = if let Some(_) = opt { true } else { false }; |
| LL + let _ = if opt.is_some() { true } else { false }; |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:90:20 |
| | |
| LL | let _ = if let Some(_) = gen_opt() { |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - let _ = if let Some(_) = gen_opt() { |
| LL + let _ = if gen_opt().is_some() { |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:93:19 |
| | |
| LL | } else if let None = gen_opt() { |
| | ^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - } else if let None = gen_opt() { |
| LL + } else if gen_opt().is_none() { |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:100:12 |
| | |
| LL | if let Some(..) = gen_opt() {} |
| | ^^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - if let Some(..) = gen_opt() {} |
| LL + if gen_opt().is_some() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:116:12 |
| | |
| LL | if let Some(_) = Some(42) {} |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - if let Some(_) = Some(42) {} |
| LL + if Some(42).is_some() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:119:12 |
| | |
| LL | if let None = None::<()> {} |
| | ^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - if let None = None::<()> {} |
| LL + if None::<()>.is_none() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:122:15 |
| | |
| LL | while let Some(_) = Some(42) {} |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - while let Some(_) = Some(42) {} |
| LL + while Some(42).is_some() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:125:15 |
| | |
| LL | while let None = None::<()> {} |
| | ^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - while let None = None::<()> {} |
| LL + while None::<()>.is_none() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:128:5 |
| | |
| LL | / match Some(42) { |
| LL | | |
| LL | | Some(_) => true, |
| LL | | None => false, |
| LL | | }; |
| | |_____^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - match Some(42) { |
| LL - |
| LL - Some(_) => true, |
| LL - None => false, |
| LL - }; |
| LL + Some(42).is_some(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:134:5 |
| | |
| LL | / match None::<()> { |
| LL | | |
| LL | | Some(_) => false, |
| LL | | None => true, |
| LL | | }; |
| | |_____^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - match None::<()> { |
| LL - |
| LL - Some(_) => false, |
| LL - None => true, |
| LL - }; |
| LL + None::<()>.is_none(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:143:12 |
| | |
| LL | if let None = *(&None::<()>) {} |
| | ^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - if let None = *(&None::<()>) {} |
| LL + if (&None::<()>).is_none() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:145:12 |
| | |
| LL | if let None = *&None::<()> {} |
| | ^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - if let None = *&None::<()> {} |
| LL + if (&None::<()>).is_none() {} |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:152:5 |
| | |
| LL | / match x { |
| LL | | |
| LL | | Some(_) => true, |
| LL | | _ => false, |
| LL | | }; |
| | |_____^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - match x { |
| LL - |
| LL - Some(_) => true, |
| LL - _ => false, |
| LL - }; |
| LL + x.is_some(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:158:5 |
| | |
| LL | / match x { |
| LL | | |
| LL | | None => true, |
| LL | | _ => false, |
| LL | | }; |
| | |_____^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - match x { |
| LL - |
| LL - None => true, |
| LL - _ => false, |
| LL - }; |
| LL + x.is_none(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:164:5 |
| | |
| LL | / match x { |
| LL | | |
| LL | | Some(_) => false, |
| LL | | _ => true, |
| LL | | }; |
| | |_____^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - match x { |
| LL - |
| LL - Some(_) => false, |
| LL - _ => true, |
| LL - }; |
| LL + x.is_none(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:170:5 |
| | |
| LL | / match x { |
| LL | | |
| LL | | None => false, |
| LL | | _ => true, |
| LL | | }; |
| | |_____^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - match x { |
| LL - |
| LL - None => false, |
| LL - _ => true, |
| LL - }; |
| LL + x.is_some(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:186:13 |
| | |
| LL | let _ = matches!(x, Some(_)); |
| | ^^^^^^^^^^^^^^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - let _ = matches!(x, Some(_)); |
| LL + let _ = x.is_some(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:189:13 |
| | |
| LL | let _ = matches!(x, None); |
| | ^^^^^^^^^^^^^^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - let _ = matches!(x, None); |
| LL + let _ = x.is_none(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:200:17 |
| | |
| LL | let _ = matches!(*p, None); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| help: consider using `is_none()` |
| | |
| LL - let _ = matches!(*p, None); |
| LL + let _ = (*p).is_none(); |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:208:16 |
| | |
| LL | if let Some(_) = x? { |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - if let Some(_) = x? { |
| LL + if x?.is_some() { |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:228:16 |
| | |
| LL | if let Some(_) = x.await { |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - if let Some(_) = x.await { |
| LL + if x.await.is_some() { |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:241:12 |
| | |
| LL | if let Some(_) = (x! {}) {}; |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - if let Some(_) = (x! {}) {}; |
| LL + if x! {}.is_some() {}; |
| | |
| |
| error: redundant pattern matching |
| --> tests/ui/redundant_pattern_matching_option.rs:243:15 |
| | |
| LL | while let Some(_) = (x! {}) {} |
| | ^^^^^^^ |
| | |
| help: consider using `is_some()` |
| | |
| LL - while let Some(_) = (x! {}) {} |
| LL + while x! {}.is_some() {} |
| | |
| |
| error: aborting due to 35 previous errors |
| |