@@ -7,10 +7,10 @@ LL | with_constructor.unwrap_or(make());
7
7
= note: `-D clippy::or-fun-call` implied by `-D warnings`
8
8
9
9
error: use of `unwrap_or` followed by a call to `new`
10
- --> $DIR/or_fun_call.rs:52:5
10
+ --> $DIR/or_fun_call.rs:52:14
11
11
|
12
12
LL | with_new.unwrap_or(Vec::new());
13
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new. unwrap_or_default()`
13
+ | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
14
14
15
15
error: use of `unwrap_or` followed by a function call
16
16
--> $DIR/or_fun_call.rs:55:21
@@ -31,16 +31,16 @@ LL | with_err_args.unwrap_or(Vec::with_capacity(12));
31
31
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| Vec::with_capacity(12))`
32
32
33
33
error: use of `unwrap_or` followed by a call to `default`
34
- --> $DIR/or_fun_call.rs:64:5
34
+ --> $DIR/or_fun_call.rs:64:24
35
35
|
36
36
LL | with_default_trait.unwrap_or(Default::default());
37
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_trait. unwrap_or_default()`
37
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
38
38
39
39
error: use of `unwrap_or` followed by a call to `default`
40
- --> $DIR/or_fun_call.rs:67:5
40
+ --> $DIR/or_fun_call.rs:67:23
41
41
|
42
42
LL | with_default_type.unwrap_or(u64::default());
43
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type. unwrap_or_default()`
43
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
44
44
45
45
error: use of `unwrap_or` followed by a function call
46
46
--> $DIR/or_fun_call.rs:70:18
@@ -49,16 +49,16 @@ LL | self_default.unwrap_or(<FakeDefault>::default());
49
49
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(<FakeDefault>::default)`
50
50
51
51
error: use of `unwrap_or` followed by a call to `default`
52
- --> $DIR/or_fun_call.rs:73:5
52
+ --> $DIR/or_fun_call.rs:73:18
53
53
|
54
54
LL | real_default.unwrap_or(<FakeDefault as Default>::default());
55
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `real_default. unwrap_or_default()`
55
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
56
56
57
57
error: use of `unwrap_or` followed by a call to `new`
58
- --> $DIR/or_fun_call.rs:76:5
58
+ --> $DIR/or_fun_call.rs:76:14
59
59
|
60
60
LL | with_vec.unwrap_or(vec![]);
61
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec. unwrap_or_default()`
61
+ | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
62
62
63
63
error: use of `unwrap_or` followed by a function call
64
64
--> $DIR/or_fun_call.rs:79:21
@@ -109,90 +109,28 @@ LL | None.unwrap_or( unsafe { ptr_to_ref(s) } );
109
109
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
110
110
111
111
error: use of `unwrap_or` followed by a call to `new`
112
- --> $DIR/or_fun_call.rs:182:9
113
- |
114
- LL | / frames
115
- LL | | .iter()
116
- LL | | .map(|f: &String| f.to_lowercase())
117
- LL | | .reduce(|mut acc, f| {
118
- ... |
119
- LL | | })
120
- LL | | .unwrap_or(String::new());
121
- | |_____________________________________^
122
- |
123
- help: try this
124
- |
125
- LL ~ frames
126
- LL + .iter()
127
- LL + .map(|f: &String| f.to_lowercase())
128
- LL + .reduce(|mut acc, f| {
129
- LL + acc.push_str(&f);
130
- LL + acc
131
- LL ~ }).unwrap_or_default();
112
+ --> $DIR/or_fun_call.rs:189:14
132
113
|
114
+ LL | .unwrap_or(String::new());
115
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
133
116
134
117
error: use of `unwrap_or` followed by a call to `new`
135
- --> $DIR/or_fun_call.rs:195:9
136
- |
137
- LL | / iter.map(|f: &String| f.to_lowercase())
138
- LL | | .reduce(|mut acc, f| {
139
- LL | | let _ = "";
140
- LL | | let _ = "";
141
- ... |
142
- LL | | })
143
- LL | | .unwrap_or(String::new());
144
- | |_____________________________________^
145
- |
146
- help: try this
147
- |
148
- LL ~ iter.map(|f: &String| f.to_lowercase())
149
- LL + .reduce(|mut acc, f| {
150
- LL + let _ = "";
151
- LL + let _ = "";
152
- LL + acc.push_str(&f);
153
- LL + acc
154
- LL ~ }).unwrap_or_default();
118
+ --> $DIR/or_fun_call.rs:202:14
155
119
|
120
+ LL | .unwrap_or(String::new());
121
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
156
122
157
123
error: use of `unwrap_or` followed by a call to `new`
158
- --> $DIR/or_fun_call.rs:208:9
159
- |
160
- LL | / iter.map(|f: &String| f.to_lowercase())
161
- LL | | .reduce(|mut acc, f| {
162
- LL | | let _ = "";
163
- LL | | acc.push_str(&f);
164
- LL | | acc
165
- LL | | })
166
- LL | | .unwrap_or(String::new());
167
- | |_____________________________________^
168
- |
169
- help: try this
170
- |
171
- LL ~ iter.map(|f: &String| f.to_lowercase())
172
- LL + .reduce(|mut acc, f| {
173
- LL + let _ = "";
174
- LL + acc.push_str(&f);
175
- LL + acc
176
- LL ~ }).unwrap_or_default();
124
+ --> $DIR/or_fun_call.rs:214:14
177
125
|
126
+ LL | .unwrap_or(String::new());
127
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
178
128
179
129
error: use of `unwrap_or` followed by a call to `new`
180
- --> $DIR/or_fun_call.rs:221:9
181
- |
182
- LL | / map.reduce(|mut acc, f| {
183
- LL | | acc.push_str(&f);
184
- LL | | acc
185
- LL | | })
186
- LL | | .unwrap_or(String::new());
187
- | |_________________________________^
188
- |
189
- help: try this
190
- |
191
- LL ~ map.reduce(|mut acc, f| {
192
- LL + acc.push_str(&f);
193
- LL + acc
194
- LL ~ }).unwrap_or_default();
130
+ --> $DIR/or_fun_call.rs:225:10
195
131
|
132
+ LL | .unwrap_or(String::new());
133
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
196
134
197
135
error: aborting due to 22 previous errors
198
136
0 commit comments