We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.unwrap
Some(_)
Suggesting inline Some(_) and .unwrap() in continuous line.
.unwrap()
let expr = ""; let token = Some(expr); let token = token.unwrap(); // assert_eq!(expr, token)
let expr = ""; let token = expr;
unnecessary_option
complexity
None
// let expr = "for any value and type"; let token = Some(expr); let token = token.unwrap(); // assert_eq!(expr, token)
Could be written as:
let token = expr;
The text was updated successfully, but these errors were encountered:
Option
This lint exists now: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_literal_unwrap
Sorry, something went wrong.
Yes, this should be closed because #10358 is merged and landed in today’s (>= 1.69.0) toolchain.
No branches or pull requests
What it does
Suggesting inline
Some(_)
and.unwrap()
in continuous line.Before
After
Lint Name
unnecessary_option
Category
complexity
Advantage
Drawbacks
None
Example
Could be written as:
The text was updated successfully, but these errors were encountered: