1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
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:74: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:143: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: aborting due to 9 previous errors
|