-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
suggest replacing let else with ? statement where applicable #8755
Comments
I guess the |
Another example where this lint would have been useful: rust-lang/cargo@cf716fc |
Given the two samples that we have, I think that most of the times the lint would fire is for functions that return |
Yes, would love to see the We currently have two patterns in our codebase with both let x = None::<u32>;
// Suggest ? here
let Some(x) = x else {
return None;
};
// Suggest .ok()? here
let Ok(x) = std::fs::read_to_string("foo") else {
return None;
}; Thanks! |
Sorry, filed via mobil which doesn't know about issue templates. 😅
might be nice if clippy could lint patterns like this: rust-lang/rust#96471
The text was updated successfully, but these errors were encountered: