-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions
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()`
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions