Closed
Description
While working on a lint I got this warning in the dog food tests
error: use of `or_insert` followed by a function call
--> clippy_lints/src/macro_use.rs:185:34
|
185 | ... .or_insert(vec![])
| ^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(vec![])`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
The suggestions also fails to compile vec![] is not a function
error. So fixing that with or_insert_with(|| vec![])
gives
error: redundant closure found
--> clippy_lints/src/macro_use.rs:194:49
|
194 | ... .or_insert_with(|| vec![])
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure