after some upgrade of msrv I get this (In a project I dont own, just doing the msrv upgrade, so removing the 'pedantic' is not OK)
error: this could be rewritten as `let...else`
--> asyncgit/src/sync/config.rs:99:2
|
99 | / let entry = match entry_res {
100 | | Ok(ent) => ent,
101 | | Err(_) => return Ok(None),
102 | | };
| |______^ help: consider writing: `let Ok(ent) = entry_res else { return Ok(None) };`
on this code
let entry_res = cfg.get_entry(key);
let entry = match entry_res {
Ok(ent) => ent,
Err(_) => return Ok(None),
};
get_entry
returns a Result<T,...>
The suggested fix is not valid code - unless I missed something obvious
Edit. When I say not valid code, I mean it won't compile, I am sure the syntax is correct and that it's my fault for not being able to follow what it's trying to do. But it's for sure a clippy bug
EDIT2 : apparently a known bug https://github.com/rust-lang/rust-clippy/issues/10171