Hi there,
I'm trying to resolve clippy's errors and warning and on the last clippy warning, if I solve it, the file doesn't compile anymore, who's wrong?
Clippy's warning:
warning: redundant closure found
--> src\pagination\tags.rs:58:18
|
58 | .or_else(|e: Error| Err(e))?;
| ^^^^^^^^^^^^^^^^^ help: remove closure as shown: `Err`
|
= 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
If I solve like suggested (or_else(Err)?;
), rustc is not happy:
error[E0282]: type annotations needed
--> src\pagination\tags.rs:48:38
|
48 | let cur_tag_paginators = create_all_paginators(
| ______________________________________^
49 | | posts,
50 | | doc,
51 | | &pagination_cfg,
52 | | Some(&liquid::value::Value::scalar(tag.to_owned())),
53 | | )?;
| |______________^ cannot infer type
What can I do?
EDIT: for the time being, I'm putting #[allow(clippy::redundant_closure)]
on this function