1 error: use of `unwrap_or` followed by a function call
2 --> $DIR/or_fun_call.rs:49:22
4 LL | with_constructor.unwrap_or(make());
5 | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(make)`
7 = note: `-D clippy::or-fun-call` implied by `-D warnings`
9 error: use of `unwrap_or` followed by a call to `new`
10 --> $DIR/or_fun_call.rs:52:14
12 LL | with_new.unwrap_or(Vec::new());
13 | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
15 error: use of `unwrap_or` followed by a function call
16 --> $DIR/or_fun_call.rs:55:21
18 LL | with_const_args.unwrap_or(Vec::with_capacity(12));
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| Vec::with_capacity(12))`
21 error: use of `unwrap_or` followed by a function call
22 --> $DIR/or_fun_call.rs:58:14
24 LL | with_err.unwrap_or(make());
25 | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| make())`
27 error: use of `unwrap_or` followed by a function call
28 --> $DIR/or_fun_call.rs:61:19
30 LL | with_err_args.unwrap_or(Vec::with_capacity(12));
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| Vec::with_capacity(12))`
33 error: use of `unwrap_or` followed by a call to `default`
34 --> $DIR/or_fun_call.rs:64:24
36 LL | with_default_trait.unwrap_or(Default::default());
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
39 error: use of `unwrap_or` followed by a call to `default`
40 --> $DIR/or_fun_call.rs:67:23
42 LL | with_default_type.unwrap_or(u64::default());
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
45 error: use of `unwrap_or` followed by a function call
46 --> $DIR/or_fun_call.rs:70:18
48 LL | self_default.unwrap_or(<FakeDefault>::default());
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(<FakeDefault>::default)`
51 error: use of `unwrap_or` followed by a call to `default`
52 --> $DIR/or_fun_call.rs:73:18
54 LL | real_default.unwrap_or(<FakeDefault as Default>::default());
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
57 error: use of `unwrap_or` followed by a call to `new`
58 --> $DIR/or_fun_call.rs:76:14
60 LL | with_vec.unwrap_or(vec![]);
61 | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
63 error: use of `unwrap_or` followed by a function call
64 --> $DIR/or_fun_call.rs:79:21
66 LL | without_default.unwrap_or(Foo::new());
67 | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(Foo::new)`
69 error: use of `unwrap_or` followed by a call to `new`
70 --> $DIR/or_fun_call.rs:94:21
72 LL | let _ = stringy.unwrap_or(String::new());
73 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
75 error: use of `unwrap_or` followed by a function call
76 --> $DIR/or_fun_call.rs:102:21
78 LL | let _ = Some(1).unwrap_or(map[&1]);
79 | ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`
81 error: use of `unwrap_or` followed by a function call
82 --> $DIR/or_fun_call.rs:104:21
84 LL | let _ = Some(1).unwrap_or(map[&1]);
85 | ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`
87 error: use of `or` followed by a function call
88 --> $DIR/or_fun_call.rs:128:35
90 LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
91 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))`
93 error: use of `unwrap_or` followed by a function call
94 --> $DIR/or_fun_call.rs:167:14
96 LL | None.unwrap_or(ptr_to_ref(s));
97 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| ptr_to_ref(s))`
99 error: use of `unwrap_or` followed by a function call
100 --> $DIR/or_fun_call.rs:173:14
102 LL | None.unwrap_or(unsafe { ptr_to_ref(s) });
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
105 error: use of `unwrap_or` followed by a function call
106 --> $DIR/or_fun_call.rs:175:14
108 LL | None.unwrap_or( unsafe { ptr_to_ref(s) } );
109 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
111 error: use of `unwrap_or` followed by a call to `new`
112 --> $DIR/or_fun_call.rs:189:14
114 LL | .unwrap_or(String::new());
115 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
117 error: use of `unwrap_or` followed by a call to `new`
118 --> $DIR/or_fun_call.rs:202:14
120 LL | .unwrap_or(String::new());
121 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
123 error: use of `unwrap_or` followed by a call to `new`
124 --> $DIR/or_fun_call.rs:214:14
126 LL | .unwrap_or(String::new());
127 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
129 error: use of `unwrap_or` followed by a call to `new`
130 --> $DIR/or_fun_call.rs:225:10
132 LL | .unwrap_or(String::new());
133 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
135 error: aborting due to 22 previous errors