Closed
Description
Clippy warns me about redundant closure:
warning: redundant closure found
--> src/parser_lib.rs:291:14
|
291 | Box::new(move |s| pf()(s))
| ^^^^^^^^^^^^^^^^ help: remove closure as shown: `pf()`
|
= note: #[warn(clippy::redundant_closure)] on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
But the suggested transformation changes semantics: the original code executes pf
only when the closure is executed; the suggested code executes pf
immediately.
> cargo clippy -V
clippy 0.0.212 (265318db 2019-05-17)