1- error: use of `unwrap_or` followed by a function call
1+ error: function call inside of `unwrap_or`
22 --> tests/ui/or_fun_call.rs:52:22
33 |
44LL | with_constructor.unwrap_or(make());
@@ -16,19 +16,19 @@ LL | with_new.unwrap_or(Vec::new());
1616 = note: `-D clippy::unwrap-or-default` implied by `-D warnings`
1717 = help: to override `-D warnings` add `#[allow(clippy::unwrap_or_default)]`
1818
19- error: use of `unwrap_or` followed by a function call
19+ error: function call inside of `unwrap_or`
2020 --> tests/ui/or_fun_call.rs:58:21
2121 |
2222LL | with_const_args.unwrap_or(Vec::with_capacity(12));
2323 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| Vec::with_capacity(12))`
2424
25- error: use of `unwrap_or` followed by a function call
25+ error: function call inside of `unwrap_or`
2626 --> tests/ui/or_fun_call.rs:61:14
2727 |
2828LL | with_err.unwrap_or(make());
2929 | ^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| make())`
3030
31- error: use of `unwrap_or` followed by a function call
31+ error: function call inside of `unwrap_or`
3232 --> tests/ui/or_fun_call.rs:64:19
3333 |
3434LL | with_err_args.unwrap_or(Vec::with_capacity(12));
@@ -46,7 +46,7 @@ error: use of `unwrap_or` to construct default value
4646LL | with_default_type.unwrap_or(u64::default());
4747 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
4848
49- error: use of `unwrap_or` followed by a function call
49+ error: function call inside of `unwrap_or`
5050 --> tests/ui/or_fun_call.rs:73:18
5151 |
5252LL | self_default.unwrap_or(<FakeDefault>::default());
@@ -64,7 +64,7 @@ error: use of `unwrap_or` to construct default value
6464LL | with_vec.unwrap_or(vec![]);
6565 | ^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
6666
67- error: use of `unwrap_or` followed by a function call
67+ error: function call inside of `unwrap_or`
6868 --> tests/ui/or_fun_call.rs:82:21
6969 |
7070LL | without_default.unwrap_or(Foo::new());
@@ -100,55 +100,55 @@ error: use of `unwrap_or` to construct default value
100100LL | let _ = stringy.unwrap_or(String::new());
101101 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
102102
103- error: use of `ok_or` followed by a function call
103+ error: function call inside of `ok_or`
104104 --> tests/ui/or_fun_call.rs:101:17
105105 |
106106LL | let _ = opt.ok_or(format!("{} world.", hello));
107107 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ok_or_else(|| format!("{} world.", hello))`
108108
109- error: use of `unwrap_or` followed by a function call
109+ error: function call inside of `unwrap_or`
110110 --> tests/ui/or_fun_call.rs:105:21
111111 |
112112LL | let _ = Some(1).unwrap_or(map[&1]);
113113 | ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| map[&1])`
114114
115- error: use of `unwrap_or` followed by a function call
115+ error: function call inside of `unwrap_or`
116116 --> tests/ui/or_fun_call.rs:107:21
117117 |
118118LL | let _ = Some(1).unwrap_or(map[&1]);
119119 | ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| map[&1])`
120120
121- error: use of `or` followed by a function call
121+ error: function call inside of `or`
122122 --> tests/ui/or_fun_call.rs:131:35
123123 |
124124LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
125125 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_else(|| Some("b".to_string()))`
126126
127- error: use of `unwrap_or` followed by a function call
127+ error: function call inside of `unwrap_or`
128128 --> tests/ui/or_fun_call.rs:170:14
129129 |
130130LL | None.unwrap_or(ptr_to_ref(s));
131131 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| ptr_to_ref(s))`
132132
133- error: use of `unwrap_or` followed by a function call
133+ error: function call inside of `unwrap_or`
134134 --> tests/ui/or_fun_call.rs:176:14
135135 |
136136LL | None.unwrap_or(unsafe { ptr_to_ref(s) });
137137 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
138138
139- error: use of `unwrap_or` followed by a function call
139+ error: function call inside of `unwrap_or`
140140 --> tests/ui/or_fun_call.rs:178:14
141141 |
142142LL | None.unwrap_or( unsafe { ptr_to_ref(s) } );
143143 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
144144
145- error: use of `map_or` followed by a function call
145+ error: function call inside of `map_or`
146146 --> tests/ui/or_fun_call.rs:253:25
147147 |
148148LL | let _ = Some(4).map_or(g(), |v| v);
149149 | ^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(g, |v| v)`
150150
151- error: use of `map_or` followed by a function call
151+ error: function call inside of `map_or`
152152 --> tests/ui/or_fun_call.rs:254:25
153153 |
154154LL | let _ = Some(4).map_or(g(), f);
@@ -196,19 +196,19 @@ error: use of `unwrap_or_else` to construct default value
196196LL | let _ = stringy.unwrap_or_else(String::new);
197197 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
198198
199- error: use of `unwrap_or` followed by a function call
199+ error: function call inside of `unwrap_or`
200200 --> tests/ui/or_fun_call.rs:345:17
201201 |
202202LL | let _ = opt.unwrap_or({ f() }); // suggest `.unwrap_or_else(f)`
203203 | ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(f)`
204204
205- error: use of `unwrap_or` followed by a function call
205+ error: function call inside of `unwrap_or`
206206 --> tests/ui/or_fun_call.rs:348:17
207207 |
208208LL | let _ = opt.unwrap_or(f() + 1); // suggest `.unwrap_or_else(|| f() + 1)`
209209 | ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| f() + 1)`
210210
211- error: use of `unwrap_or` followed by a function call
211+ error: function call inside of `unwrap_or`
212212 --> tests/ui/or_fun_call.rs:351:17
213213 |
214214LL | let _ = opt.unwrap_or({
@@ -226,7 +226,7 @@ LL + x + 1
226226LL ~ });
227227 |
228228
229- error: use of `map_or` followed by a function call
229+ error: function call inside of `map_or`
230230 --> tests/ui/or_fun_call.rs:356:17
231231 |
232232LL | let _ = opt.map_or(f() + 1, |v| v); // suggest `.map_or_else(|| f() + 1, |v| v)`
@@ -238,7 +238,7 @@ error: use of `unwrap_or` to construct default value
238238LL | let _ = opt.unwrap_or({ i32::default() });
239239 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
240240
241- error: use of `unwrap_or` followed by a function call
241+ error: function call inside of `unwrap_or`
242242 --> tests/ui/or_fun_call.rs:365:21
243243 |
244244LL | let _ = opt_foo.unwrap_or(Foo { val: String::default() });
0 commit comments