2024-03-08 15:04:31 -06:00
|
|
|
error: match can be simplified with `.unwrap_or_default()`
|
2024-03-09 18:12:15 -06:00
|
|
|
--> tests/ui/manual_unwrap_or_default.rs:6:5
|
2024-03-08 15:04:31 -06:00
|
|
|
|
|
|
|
|
LL | / match x {
|
|
|
|
LL | |
|
|
|
|
LL | | Some(v) => v,
|
|
|
|
LL | | None => Vec::default(),
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: replace it with: `x.unwrap_or_default()`
|
|
|
|
|
|
2024-03-09 18:12:15 -06:00
|
|
|
= note: `-D clippy::manual-unwrap-or-default` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::manual_unwrap_or_default)]`
|
2024-03-08 15:04:31 -06:00
|
|
|
|
|
|
|
error: match can be simplified with `.unwrap_or_default()`
|
2024-03-09 18:12:15 -06:00
|
|
|
--> tests/ui/manual_unwrap_or_default.rs:13:5
|
2024-03-08 15:04:31 -06:00
|
|
|
|
|
|
|
|
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()`
|
2024-03-09 18:12:15 -06:00
|
|
|
--> tests/ui/manual_unwrap_or_default.rs:20:5
|
2024-03-08 15:04:31 -06:00
|
|
|
|
|
|
|
|
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()`
|
2024-03-09 18:12:15 -06:00
|
|
|
--> tests/ui/manual_unwrap_or_default.rs:27:5
|
2024-03-08 15:04:31 -06:00
|
|
|
|
|
|
|
|
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()`
|
2024-03-09 18:12:15 -06:00
|
|
|
--> tests/ui/manual_unwrap_or_default.rs:34:5
|
2024-03-08 15:04:31 -06:00
|
|
|
|
|
|
|
|
LL | / if let Some(v) = x {
|
|
|
|
LL | |
|
|
|
|
LL | | v
|
|
|
|
LL | | } else {
|
|
|
|
LL | | Vec::default()
|
|
|
|
LL | | };
|
|
|
|
| |_____^ help: replace it with: `x.unwrap_or_default()`
|
|
|
|
|
2024-03-22 06:21:35 -05:00
|
|
|
error: match can be simplified with `.unwrap_or_default()`
|
2024-04-01 09:48:03 -05:00
|
|
|
--> tests/ui/manual_unwrap_or_default.rs:56:20
|
2024-03-22 06:21:35 -05:00
|
|
|
|
|
|
|
|
LL | Some(_) => match *b {
|
|
|
|
| ____________________^
|
|
|
|
LL | | Some(v) => v,
|
|
|
|
LL | | _ => 0,
|
|
|
|
LL | | },
|
|
|
|
| |_________^ help: replace it with: `(*b).unwrap_or_default()`
|
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
2024-03-08 15:04:31 -06:00
|
|
|
|