Skip to content
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

FN question_mark: if let binding #5260

Closed
matthiaskrgr opened this issue Mar 3, 2020 · 0 comments · Fixed by #5266
Closed

FN question_mark: if let binding #5260

matthiaskrgr opened this issue Mar 3, 2020 · 0 comments · Fixed by #5266
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-suggestion Lint: Improving, adding or fixing lint suggestions T-AST Type: Requires working with the AST

Comments

@matthiaskrgr
Copy link
Member

if let Some(n) = n.try_eval_usize(self.lcx.tcx, self.lcx.param_env) {
    n
} else {
    return None;
}

can be simplified to

n.try_eval_usize(self.lcx.tcx, self.lcx.param_env)?

but the lint does not report it

@flip1995 flip1995 added L-suggestion Lint: Improving, adding or fixing lint suggestions good-first-issue These issues are a good way to get started with Clippy A-lint Area: New lints T-AST Type: Requires working with the AST labels Mar 3, 2020
@bors bors closed this as completed in 8c7b3ad Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy L-suggestion Lint: Improving, adding or fixing lint suggestions T-AST Type: Requires working with the AST
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants