]>
Commit | Line | Data |
---|---|---|
f20569fa | 1 | error: use of `unwrap_or` followed by a function call |
c620b35d | 2 | --> tests/ui/or_fun_call.rs:52:22 |
f20569fa XL |
3 | | |
4 | LL | with_constructor.unwrap_or(make()); | |
add651ee | 5 | | ^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(make)` |
a2a8927a XL |
6 | | |
7 | = note: `-D clippy::or-fun-call` implied by `-D warnings` | |
781aab86 | 8 | = help: to override `-D warnings` add `#[allow(clippy::or_fun_call)]` |
f20569fa | 9 | |
add651ee | 10 | error: use of `unwrap_or` to construct default value |
c620b35d | 11 | --> tests/ui/or_fun_call.rs:55:14 |
f20569fa XL |
12 | | |
13 | LL | with_new.unwrap_or(Vec::new()); | |
add651ee FG |
14 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` |
15 | | | |
16 | = note: `-D clippy::unwrap-or-default` implied by `-D warnings` | |
781aab86 | 17 | = help: to override `-D warnings` add `#[allow(clippy::unwrap_or_default)]` |
f20569fa XL |
18 | |
19 | error: use of `unwrap_or` followed by a function call | |
c620b35d | 20 | --> tests/ui/or_fun_call.rs:58:21 |
f20569fa XL |
21 | | |
22 | LL | with_const_args.unwrap_or(Vec::with_capacity(12)); | |
add651ee | 23 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| Vec::with_capacity(12))` |
f20569fa XL |
24 | |
25 | error: use of `unwrap_or` followed by a function call | |
c620b35d | 26 | --> tests/ui/or_fun_call.rs:61:14 |
f20569fa XL |
27 | | |
28 | LL | with_err.unwrap_or(make()); | |
add651ee | 29 | | ^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| make())` |
f20569fa XL |
30 | |
31 | error: use of `unwrap_or` followed by a function call | |
c620b35d | 32 | --> tests/ui/or_fun_call.rs:64:19 |
f20569fa XL |
33 | | |
34 | LL | with_err_args.unwrap_or(Vec::with_capacity(12)); | |
add651ee | 35 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| Vec::with_capacity(12))` |
f20569fa | 36 | |
add651ee | 37 | error: use of `unwrap_or` to construct default value |
c620b35d | 38 | --> tests/ui/or_fun_call.rs:67:24 |
f20569fa XL |
39 | | |
40 | LL | with_default_trait.unwrap_or(Default::default()); | |
add651ee | 41 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` |
f20569fa | 42 | |
add651ee | 43 | error: use of `unwrap_or` to construct default value |
c620b35d | 44 | --> tests/ui/or_fun_call.rs:70:23 |
f20569fa XL |
45 | | |
46 | LL | with_default_type.unwrap_or(u64::default()); | |
add651ee | 47 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` |
f20569fa | 48 | |
94222f64 | 49 | error: use of `unwrap_or` followed by a function call |
c620b35d | 50 | --> tests/ui/or_fun_call.rs:73:18 |
94222f64 XL |
51 | | |
52 | LL | self_default.unwrap_or(<FakeDefault>::default()); | |
add651ee | 53 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(<FakeDefault>::default)` |
94222f64 | 54 | |
add651ee | 55 | error: use of `unwrap_or` to construct default value |
c620b35d | 56 | --> tests/ui/or_fun_call.rs:76:18 |
94222f64 XL |
57 | | |
58 | LL | real_default.unwrap_or(<FakeDefault as Default>::default()); | |
add651ee | 59 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` |
94222f64 | 60 | |
add651ee | 61 | error: use of `unwrap_or` to construct default value |
c620b35d | 62 | --> tests/ui/or_fun_call.rs:79:14 |
f20569fa XL |
63 | | |
64 | LL | with_vec.unwrap_or(vec![]); | |
add651ee | 65 | | ^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` |
f20569fa XL |
66 | |
67 | error: use of `unwrap_or` followed by a function call | |
c620b35d | 68 | --> tests/ui/or_fun_call.rs:82:21 |
f20569fa XL |
69 | | |
70 | LL | without_default.unwrap_or(Foo::new()); | |
add651ee | 71 | | ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(Foo::new)` |
f20569fa | 72 | |
add651ee | 73 | error: use of `or_insert` to construct default value |
c620b35d | 74 | --> tests/ui/or_fun_call.rs:85:19 |
f2b60f7d FG |
75 | | |
76 | LL | map.entry(42).or_insert(String::new()); | |
add651ee | 77 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` |
f2b60f7d | 78 | |
add651ee | 79 | error: use of `or_insert` to construct default value |
c620b35d | 80 | --> tests/ui/or_fun_call.rs:88:23 |
f2b60f7d FG |
81 | | |
82 | LL | map_vec.entry(42).or_insert(vec![]); | |
add651ee | 83 | | ^^^^^^^^^^^^^^^^^ help: try: `or_default()` |
f2b60f7d | 84 | |
add651ee | 85 | error: use of `or_insert` to construct default value |
c620b35d | 86 | --> tests/ui/or_fun_call.rs:91:21 |
f2b60f7d FG |
87 | | |
88 | LL | btree.entry(42).or_insert(String::new()); | |
add651ee | 89 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` |
f2b60f7d | 90 | |
add651ee | 91 | error: use of `or_insert` to construct default value |
c620b35d | 92 | --> tests/ui/or_fun_call.rs:94:25 |
f2b60f7d FG |
93 | | |
94 | LL | btree_vec.entry(42).or_insert(vec![]); | |
add651ee | 95 | | ^^^^^^^^^^^^^^^^^ help: try: `or_default()` |
f2b60f7d | 96 | |
add651ee | 97 | error: use of `unwrap_or` to construct default value |
c620b35d | 98 | --> tests/ui/or_fun_call.rs:97:21 |
f20569fa | 99 | | |
f2b60f7d | 100 | LL | let _ = stringy.unwrap_or(String::new()); |
add651ee | 101 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` |
f20569fa XL |
102 | |
103 | error: use of `unwrap_or` followed by a function call | |
c620b35d | 104 | --> tests/ui/or_fun_call.rs:105:21 |
f20569fa XL |
105 | | |
106 | LL | let _ = Some(1).unwrap_or(map[&1]); | |
add651ee | 107 | | ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| map[&1])` |
f20569fa XL |
108 | |
109 | error: use of `unwrap_or` followed by a function call | |
c620b35d | 110 | --> tests/ui/or_fun_call.rs:107:21 |
f20569fa XL |
111 | | |
112 | LL | let _ = Some(1).unwrap_or(map[&1]); | |
add651ee | 113 | | ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| map[&1])` |
f20569fa XL |
114 | |
115 | error: use of `or` followed by a function call | |
c620b35d | 116 | --> tests/ui/or_fun_call.rs:131:35 |
f20569fa XL |
117 | | |
118 | LL | let _ = Some("a".to_string()).or(Some("b".to_string())); | |
add651ee | 119 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_else(|| Some("b".to_string()))` |
f20569fa | 120 | |
cdc7bbd5 | 121 | error: use of `unwrap_or` followed by a function call |
c620b35d | 122 | --> tests/ui/or_fun_call.rs:170:14 |
cdc7bbd5 | 123 | | |
a2a8927a | 124 | LL | None.unwrap_or(ptr_to_ref(s)); |
add651ee | 125 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| ptr_to_ref(s))` |
cdc7bbd5 XL |
126 | |
127 | error: use of `unwrap_or` followed by a function call | |
c620b35d | 128 | --> tests/ui/or_fun_call.rs:176:14 |
cdc7bbd5 | 129 | | |
a2a8927a | 130 | LL | None.unwrap_or(unsafe { ptr_to_ref(s) }); |
add651ee | 131 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })` |
cdc7bbd5 XL |
132 | |
133 | error: use of `unwrap_or` followed by a function call | |
c620b35d | 134 | --> tests/ui/or_fun_call.rs:178:14 |
cdc7bbd5 | 135 | | |
a2a8927a | 136 | LL | None.unwrap_or( unsafe { ptr_to_ref(s) } ); |
add651ee | 137 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })` |
cdc7bbd5 | 138 | |
add651ee | 139 | error: use of `map_or` followed by a function call |
c620b35d | 140 | --> tests/ui/or_fun_call.rs:253:25 |
5099ac24 | 141 | | |
add651ee FG |
142 | LL | let _ = Some(4).map_or(g(), |v| v); |
143 | | ^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(g, |v| v)` | |
5099ac24 | 144 | |
add651ee | 145 | error: use of `map_or` followed by a function call |
c620b35d | 146 | --> tests/ui/or_fun_call.rs:254:25 |
5099ac24 | 147 | | |
add651ee FG |
148 | LL | let _ = Some(4).map_or(g(), f); |
149 | | ^^^^^^^^^^^^^^ help: try: `map_or_else(g, f)` | |
5099ac24 | 150 | |
add651ee | 151 | error: use of `unwrap_or_else` to construct default value |
c620b35d | 152 | --> tests/ui/or_fun_call.rs:285:18 |
5099ac24 | 153 | | |
add651ee FG |
154 | LL | with_new.unwrap_or_else(Vec::new); |
155 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` | |
5099ac24 | 156 | |
add651ee | 157 | error: use of `unwrap_or_else` to construct default value |
c620b35d | 158 | --> tests/ui/or_fun_call.rs:288:28 |
5099ac24 | 159 | | |
add651ee FG |
160 | LL | with_default_trait.unwrap_or_else(Default::default); |
161 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` | |
5099ac24 | 162 | |
add651ee | 163 | error: use of `unwrap_or_else` to construct default value |
c620b35d | 164 | --> tests/ui/or_fun_call.rs:291:27 |
487cf647 | 165 | | |
add651ee FG |
166 | LL | with_default_type.unwrap_or_else(u64::default); |
167 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` | |
487cf647 | 168 | |
add651ee | 169 | error: use of `unwrap_or_else` to construct default value |
c620b35d | 170 | --> tests/ui/or_fun_call.rs:294:22 |
487cf647 | 171 | | |
add651ee FG |
172 | LL | real_default.unwrap_or_else(<FakeDefault as Default>::default); |
173 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` | |
174 | ||
175 | error: use of `or_insert_with` to construct default value | |
c620b35d | 176 | --> tests/ui/or_fun_call.rs:297:23 |
add651ee FG |
177 | | |
178 | LL | map.entry(42).or_insert_with(String::new); | |
179 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | |
180 | ||
181 | error: use of `or_insert_with` to construct default value | |
c620b35d | 182 | --> tests/ui/or_fun_call.rs:300:25 |
add651ee FG |
183 | | |
184 | LL | btree.entry(42).or_insert_with(String::new); | |
185 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` | |
186 | ||
187 | error: use of `unwrap_or_else` to construct default value | |
c620b35d | 188 | --> tests/ui/or_fun_call.rs:303:25 |
add651ee FG |
189 | | |
190 | LL | let _ = stringy.unwrap_or_else(String::new); | |
191 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` | |
487cf647 | 192 | |
add651ee | 193 | error: aborting due to 31 previous errors |
f20569fa | 194 |