Closed
Description
It'd be nice for if_let_some_result
to have suggestions. I think implementation should be easy.
https://rust-lang.github.io/rust-clippy/master/index.html#if_let_some_result
Example:
fn str_to_int(x: &str) -> i32 {
if let Some(y) = x.parse().ok() {
y
} else {
0
}
}
suggests like this:
if let Some(y) = x.parse().ok() {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `if let Ok(y) = x.parse()`