@@ -7,10 +7,10 @@ LL | with_constructor.unwrap_or(make());
77 = note: `-D clippy::or-fun-call` implied by `-D warnings`
88
99error: 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
1111 |
1212LL | with_new.unwrap_or(Vec::new());
13- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new. unwrap_or_default()`
13+ | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
1414
1515error: use of `unwrap_or` followed by a function call
1616 --> $DIR/or_fun_call.rs:55:21
@@ -31,16 +31,16 @@ LL | with_err_args.unwrap_or(Vec::with_capacity(12));
3131 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| Vec::with_capacity(12))`
3232
3333error: 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
3535 |
3636LL | with_default_trait.unwrap_or(Default::default());
37- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_trait. unwrap_or_default()`
37+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
3838
3939error: 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
4141 |
4242LL | with_default_type.unwrap_or(u64::default());
43- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type. unwrap_or_default()`
43+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
4444
4545error: use of `unwrap_or` followed by a function call
4646 --> $DIR/or_fun_call.rs:70:18
@@ -49,16 +49,16 @@ LL | self_default.unwrap_or(<FakeDefault>::default());
4949 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(<FakeDefault>::default)`
5050
5151error: 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
5353 |
5454LL | real_default.unwrap_or(<FakeDefault as Default>::default());
55- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `real_default. unwrap_or_default()`
55+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
5656
5757error: 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
5959 |
6060LL | with_vec.unwrap_or(vec![]);
61- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec. unwrap_or_default()`
61+ | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
6262
6363error: use of `unwrap_or` followed by a function call
6464 --> $DIR/or_fun_call.rs:79:21
@@ -109,90 +109,28 @@ LL | None.unwrap_or( unsafe { ptr_to_ref(s) } );
109109 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
110110
111111error: 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
132113 |
114+ LL | .unwrap_or(String::new());
115+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
133116
134117error: 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
155119 |
120+ LL | .unwrap_or(String::new());
121+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
156122
157123error: 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
177125 |
126+ LL | .unwrap_or(String::new());
127+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
178128
179129error: 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
195131 |
132+ LL | .unwrap_or(String::new());
133+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
196134
197135error: aborting due to 22 previous errors
198136
0 commit comments