|
1 | 1 | error: use of `unwrap_or` followed by a function call |
2 | | - --> $DIR/or_fun_call.rs:31:22 |
| 2 | + --> $DIR/or_fun_call.rs:32:22 |
3 | 3 | | |
4 | 4 | LL | with_constructor.unwrap_or(make()); |
5 | 5 | | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(make)` |
6 | 6 | | |
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:34:5 |
| 10 | + --> $DIR/or_fun_call.rs:35:5 |
11 | 11 | | |
12 | 12 | LL | with_new.unwrap_or(Vec::new()); |
13 | 13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new.unwrap_or_default()` |
14 | 14 |
|
15 | 15 | error: use of `unwrap_or` followed by a function call |
16 | | - --> $DIR/or_fun_call.rs:37:21 |
| 16 | + --> $DIR/or_fun_call.rs:38:21 |
17 | 17 | | |
18 | 18 | LL | with_const_args.unwrap_or(Vec::with_capacity(12)); |
19 | 19 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| Vec::with_capacity(12))` |
20 | 20 |
|
21 | 21 | error: use of `unwrap_or` followed by a function call |
22 | | - --> $DIR/or_fun_call.rs:40:14 |
| 22 | + --> $DIR/or_fun_call.rs:41:14 |
23 | 23 | | |
24 | 24 | LL | with_err.unwrap_or(make()); |
25 | 25 | | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| make())` |
26 | 26 |
|
27 | 27 | error: use of `unwrap_or` followed by a function call |
28 | | - --> $DIR/or_fun_call.rs:43:19 |
| 28 | + --> $DIR/or_fun_call.rs:44:19 |
29 | 29 | | |
30 | 30 | 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:46:5 |
| 34 | + --> $DIR/or_fun_call.rs:47:5 |
35 | 35 | | |
36 | 36 | LL | with_default_trait.unwrap_or(Default::default()); |
37 | 37 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_trait.unwrap_or_default()` |
38 | 38 |
|
39 | 39 | error: use of `unwrap_or` followed by a call to `default` |
40 | | - --> $DIR/or_fun_call.rs:49:5 |
| 40 | + --> $DIR/or_fun_call.rs:50:5 |
41 | 41 | | |
42 | 42 | LL | with_default_type.unwrap_or(u64::default()); |
43 | 43 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type.unwrap_or_default()` |
44 | 44 |
|
45 | 45 | error: use of `unwrap_or` followed by a function call |
46 | | - --> $DIR/or_fun_call.rs:52:14 |
| 46 | + --> $DIR/or_fun_call.rs:53:14 |
47 | 47 | | |
48 | 48 | LL | with_vec.unwrap_or(vec![]); |
49 | 49 | | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| vec![])` |
50 | 50 |
|
51 | 51 | error: use of `unwrap_or` followed by a function call |
52 | | - --> $DIR/or_fun_call.rs:57:21 |
| 52 | + --> $DIR/or_fun_call.rs:58:21 |
53 | 53 | | |
54 | 54 | LL | without_default.unwrap_or(Foo::new()); |
55 | 55 | | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(Foo::new)` |
56 | 56 |
|
57 | 57 | error: use of `or_insert` followed by a function call |
58 | | - --> $DIR/or_fun_call.rs:60:19 |
| 58 | + --> $DIR/or_fun_call.rs:61:19 |
59 | 59 | | |
60 | 60 | LL | map.entry(42).or_insert(String::new()); |
61 | 61 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)` |
62 | 62 |
|
63 | 63 | error: use of `or_insert` followed by a function call |
64 | | - --> $DIR/or_fun_call.rs:63:21 |
| 64 | + --> $DIR/or_fun_call.rs:64:21 |
65 | 65 | | |
66 | 66 | LL | btree.entry(42).or_insert(String::new()); |
67 | 67 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)` |
68 | 68 |
|
69 | 69 | error: use of `unwrap_or` followed by a function call |
70 | | - --> $DIR/or_fun_call.rs:66:21 |
| 70 | + --> $DIR/or_fun_call.rs:67:21 |
71 | 71 | | |
72 | 72 | LL | let _ = stringy.unwrap_or("".to_owned()); |
73 | 73 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())` |
74 | 74 |
|
75 | 75 | error: use of `ok_or` followed by a function call |
76 | | - --> $DIR/or_fun_call.rs:70:17 |
| 76 | + --> $DIR/or_fun_call.rs:71:17 |
77 | 77 | | |
78 | 78 | LL | let _ = opt.ok_or(format!("{} world.", hello)); |
79 | 79 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `ok_or_else(|| format!("{} world.", hello))` |
80 | 80 |
|
81 | | -error: aborting due to 13 previous errors |
| 81 | +error: use of `or` followed by a function call |
| 82 | + --> $DIR/or_fun_call.rs:92:35 |
| 83 | + | |
| 84 | +LL | let _ = Some("a".to_string()).or(Some("b".to_string())); |
| 85 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))` |
| 86 | + |
| 87 | +error: aborting due to 14 previous errors |
82 | 88 |
|
0 commit comments