Closed
Description
In cargo-cache
I have code like this
let split: Result<Vec<u32>, _> = date.split(':').map(str::parse).collect();
let split = match split {
Ok(result) => result,
Err(a) => return Err(Error::DateParseFailure(a.to_string(), "u32".into())),
};
And clippy put the entire match statement into the warning, seems a bit excessive..?
warning: `split` is shadowed by `match split {
Ok(result) => result,
Err(a) => return Err(Error::DateParseFailure(a.to_string(), "u32".into())),
}` which reuses the original value
--> src/date.rs:65:17
|
65 | let split = match split {
| ^^^^^
|
note: previous binding is here
--> src/date.rs:64:17
|
64 | let split: Result<Vec<u32>, _> = date.split(':').map(str::parse).collect();
| ^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse
clippy 0.1.57 (da3b4b459 2021-10-02)