|
1 | 1 | error: use of `unwrap_or` followed by a function call
|
2 |
| - --> $DIR/or_fun_call.rs:47:19 |
| 2 | + --> $DIR/or_fun_call.rs:46:19 |
3 | 3 | |
|
4 | 4 | LL | with_const_fn.unwrap_or(Duration::from_secs(5));
|
5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| Duration::from_secs(5))`
|
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 function call
|
10 |
| - --> $DIR/or_fun_call.rs:50:22 |
| 10 | + --> $DIR/or_fun_call.rs:49:22 |
11 | 11 | |
|
12 | 12 | LL | with_constructor.unwrap_or(make());
|
13 | 13 | | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(make)`
|
14 | 14 |
|
15 | 15 | error: use of `unwrap_or` followed by a call to `new`
|
16 |
| - --> $DIR/or_fun_call.rs:53:5 |
| 16 | + --> $DIR/or_fun_call.rs:52:5 |
17 | 17 | |
|
18 | 18 | LL | with_new.unwrap_or(Vec::new());
|
19 | 19 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new.unwrap_or_default()`
|
20 | 20 |
|
21 | 21 | error: use of `unwrap_or` followed by a function call
|
22 |
| - --> $DIR/or_fun_call.rs:56:21 |
| 22 | + --> $DIR/or_fun_call.rs:55:21 |
23 | 23 | |
|
24 | 24 | LL | with_const_args.unwrap_or(Vec::with_capacity(12));
|
25 | 25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| Vec::with_capacity(12))`
|
26 | 26 |
|
27 | 27 | error: use of `unwrap_or` followed by a function call
|
28 |
| - --> $DIR/or_fun_call.rs:59:14 |
| 28 | + --> $DIR/or_fun_call.rs:58:14 |
29 | 29 | |
|
30 | 30 | LL | with_err.unwrap_or(make());
|
31 | 31 | | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| make())`
|
32 | 32 |
|
33 | 33 | error: use of `unwrap_or` followed by a function call
|
34 |
| - --> $DIR/or_fun_call.rs:62:19 |
| 34 | + --> $DIR/or_fun_call.rs:61:19 |
35 | 35 | |
|
36 | 36 | LL | with_err_args.unwrap_or(Vec::with_capacity(12));
|
37 | 37 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| Vec::with_capacity(12))`
|
38 | 38 |
|
39 | 39 | error: use of `unwrap_or` followed by a call to `default`
|
40 |
| - --> $DIR/or_fun_call.rs:65:5 |
| 40 | + --> $DIR/or_fun_call.rs:64:5 |
41 | 41 | |
|
42 | 42 | LL | with_default_trait.unwrap_or(Default::default());
|
43 | 43 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_trait.unwrap_or_default()`
|
44 | 44 |
|
45 | 45 | error: use of `unwrap_or` followed by a call to `default`
|
46 |
| - --> $DIR/or_fun_call.rs:68:5 |
| 46 | + --> $DIR/or_fun_call.rs:67:5 |
47 | 47 | |
|
48 | 48 | LL | with_default_type.unwrap_or(u64::default());
|
49 | 49 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type.unwrap_or_default()`
|
50 | 50 |
|
51 | 51 | error: use of `unwrap_or` followed by a function call
|
52 |
| - --> $DIR/or_fun_call.rs:71:18 |
| 52 | + --> $DIR/or_fun_call.rs:70:18 |
53 | 53 | |
|
54 | 54 | LL | self_default.unwrap_or(<FakeDefault>::default());
|
55 | 55 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(<FakeDefault>::default)`
|
56 | 56 |
|
57 | 57 | error: use of `unwrap_or` followed by a call to `default`
|
58 |
| - --> $DIR/or_fun_call.rs:74:5 |
| 58 | + --> $DIR/or_fun_call.rs:73:5 |
59 | 59 | |
|
60 | 60 | LL | real_default.unwrap_or(<FakeDefault as Default>::default());
|
61 | 61 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `real_default.unwrap_or_default()`
|
62 | 62 |
|
63 | 63 | error: use of `unwrap_or` followed by a call to `new`
|
64 |
| - --> $DIR/or_fun_call.rs:77:5 |
| 64 | + --> $DIR/or_fun_call.rs:76:5 |
65 | 65 | |
|
66 | 66 | LL | with_vec.unwrap_or(vec![]);
|
67 | 67 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec.unwrap_or_default()`
|
68 | 68 |
|
69 | 69 | error: use of `unwrap_or` followed by a function call
|
70 |
| - --> $DIR/or_fun_call.rs:80:21 |
| 70 | + --> $DIR/or_fun_call.rs:79:21 |
71 | 71 | |
|
72 | 72 | LL | without_default.unwrap_or(Foo::new());
|
73 | 73 | | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(Foo::new)`
|
74 | 74 |
|
75 | 75 | error: use of `or_insert` followed by a function call
|
76 |
| - --> $DIR/or_fun_call.rs:83:19 |
| 76 | + --> $DIR/or_fun_call.rs:82:19 |
77 | 77 | |
|
78 | 78 | LL | map.entry(42).or_insert(String::new());
|
79 | 79 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
|
80 | 80 |
|
81 | 81 | error: use of `or_insert` followed by a function call
|
82 |
| - --> $DIR/or_fun_call.rs:86:23 |
| 82 | + --> $DIR/or_fun_call.rs:85:23 |
83 | 83 | |
|
84 | 84 | LL | map_vec.entry(42).or_insert(vec![]);
|
85 | 85 | | ^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(Vec::new)`
|
86 | 86 |
|
87 | 87 | error: use of `or_insert` followed by a function call
|
88 |
| - --> $DIR/or_fun_call.rs:89:21 |
| 88 | + --> $DIR/or_fun_call.rs:88:21 |
89 | 89 | |
|
90 | 90 | LL | btree.entry(42).or_insert(String::new());
|
91 | 91 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
|
92 | 92 |
|
93 | 93 | error: use of `or_insert` followed by a function call
|
94 |
| - --> $DIR/or_fun_call.rs:92:25 |
| 94 | + --> $DIR/or_fun_call.rs:91:25 |
95 | 95 | |
|
96 | 96 | LL | btree_vec.entry(42).or_insert(vec![]);
|
97 | 97 | | ^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(Vec::new)`
|
98 | 98 |
|
99 | 99 | error: use of `unwrap_or` followed by a function call
|
100 |
| - --> $DIR/or_fun_call.rs:95:21 |
| 100 | + --> $DIR/or_fun_call.rs:94:21 |
101 | 101 | |
|
102 | 102 | LL | let _ = stringy.unwrap_or("".to_owned());
|
103 | 103 | | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`
|
104 | 104 |
|
105 | 105 | error: use of `unwrap_or` followed by a function call
|
106 |
| - --> $DIR/or_fun_call.rs:103:21 |
| 106 | + --> $DIR/or_fun_call.rs:102:21 |
107 | 107 | |
|
108 | 108 | LL | let _ = Some(1).unwrap_or(map[&1]);
|
109 | 109 | | ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`
|
110 | 110 |
|
111 | 111 | error: use of `unwrap_or` followed by a function call
|
112 |
| - --> $DIR/or_fun_call.rs:105:21 |
| 112 | + --> $DIR/or_fun_call.rs:104:21 |
113 | 113 | |
|
114 | 114 | LL | let _ = Some(1).unwrap_or(map[&1]);
|
115 | 115 | | ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`
|
116 | 116 |
|
117 | 117 | error: use of `or` followed by a function call
|
118 |
| - --> $DIR/or_fun_call.rs:129:35 |
| 118 | + --> $DIR/or_fun_call.rs:128:35 |
119 | 119 | |
|
120 | 120 | LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
|
121 | 121 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))`
|
122 | 122 |
|
123 | 123 | error: use of `or` followed by a function call
|
124 |
| - --> $DIR/or_fun_call.rs:133:10 |
| 124 | + --> $DIR/or_fun_call.rs:132:10 |
125 | 125 | |
|
126 | 126 | LL | .or(Some(Bar(b, Duration::from_secs(2))));
|
127 | 127 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some(Bar(b, Duration::from_secs(2))))`
|
128 | 128 |
|
129 | 129 | error: use of `unwrap_or` followed by a function call
|
130 |
| - --> $DIR/or_fun_call.rs:161:14 |
| 130 | + --> $DIR/or_fun_call.rs:160:14 |
131 | 131 | |
|
132 | 132 | LL | None.unwrap_or(s.as_mut_vec());
|
133 | 133 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| s.as_mut_vec())`
|
134 | 134 |
|
135 | 135 | error: use of `unwrap_or` followed by a function call
|
136 |
| - --> $DIR/or_fun_call.rs:166:14 |
| 136 | + --> $DIR/or_fun_call.rs:165:14 |
137 | 137 | |
|
138 | 138 | LL | None.unwrap_or(unsafe { s.as_mut_vec() });
|
139 | 139 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| unsafe { s.as_mut_vec() })`
|
140 | 140 |
|
141 | 141 | error: use of `unwrap_or` followed by a function call
|
142 |
| - --> $DIR/or_fun_call.rs:168:14 |
| 142 | + --> $DIR/or_fun_call.rs:167:14 |
143 | 143 | |
|
144 | 144 | LL | None.unwrap_or( unsafe { s.as_mut_vec() } );
|
145 | 145 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| unsafe { s.as_mut_vec() })`
|
|
0 commit comments