| error: match can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:6:5 |
| | |
| LL | / match x { |
| LL | | |
| LL | | Some(v) => v, |
| LL | | None => Vec::default(), |
| LL | | }; |
| | |_____^ help: replace it with: `x.unwrap_or_default()` |
| | |
| = note: `-D clippy::manual-unwrap-or-default` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::manual_unwrap_or_default)]` |
| |
| error: match can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:13:5 |
| | |
| LL | / match x { |
| LL | | |
| LL | | Some(v) => v, |
| LL | | _ => Vec::default(), |
| LL | | }; |
| | |_____^ help: replace it with: `x.unwrap_or_default()` |
| |
| error: match can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:20:5 |
| | |
| LL | / match x { |
| LL | | |
| LL | | Some(v) => v, |
| LL | | None => String::new(), |
| LL | | }; |
| | |_____^ help: replace it with: `x.unwrap_or_default()` |
| |
| error: match can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:27:5 |
| | |
| LL | / match x { |
| LL | | |
| LL | | None => Vec::default(), |
| LL | | Some(v) => v, |
| LL | | }; |
| | |_____^ help: replace it with: `x.unwrap_or_default()` |
| |
| error: if let can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:34:5 |
| | |
| LL | / if let Some(v) = x { |
| LL | | |
| LL | | |
| LL | | v |
| LL | | } else { |
| LL | | Vec::default() |
| LL | | }; |
| | |_____^ help: replace it with: `x.unwrap_or_default()` |
| |
| error: match can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:53:5 |
| | |
| LL | / match x { |
| LL | | |
| LL | | Ok(v) => v, |
| LL | | Err(_) => String::new(), |
| LL | | }; |
| | |_____^ help: replace it with: `x.unwrap_or_default()` |
| |
| error: if let can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:60:5 |
| | |
| LL | / if let Ok(v) = x { |
| LL | | |
| LL | | |
| LL | | v |
| LL | | } else { |
| LL | | String::new() |
| LL | | }; |
| | |_____^ help: replace it with: `x.unwrap_or_default()` |
| |
| error: match can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:83:24 |
| | |
| LL | Some(_) => match *b { |
| | ________________________^ |
| LL | | |
| LL | | Some(v) => v, |
| LL | | _ => 0, |
| LL | | }, |
| | |_____________^ help: replace it with: `(*b).unwrap_or_default()` |
| |
| error: if let can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:152:5 |
| | |
| LL | / if let Some(x) = Some(42) { |
| LL | | |
| LL | | x |
| LL | | } else { |
| LL | | 0 |
| LL | | } |
| | |_____^ help: replace it with: `Some(42).unwrap_or_default()` |
| |
| error: if let can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:178:13 |
| | |
| LL | let _ = if let Ok(v) = x { v } else { 0 }; |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x.unwrap_or_default()` |
| |
| error: if let can be simplified with `.unwrap_or_default()` |
| --> tests/ui/manual_unwrap_or_default.rs:182:13 |
| | |
| LL | let _ = if let Ok(v) = copyable_res { v } else { 0 }; |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `copyable_res.unwrap_or_default()` |
| |
| error: aborting due to 11 previous errors |
| |