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

needless option take improvement #8740

Open
b-ncMN opened this issue Apr 24, 2022 · 0 comments
Open

needless option take improvement #8740

b-ncMN opened this issue Apr 24, 2022 · 0 comments
Labels
A-lint Area: New lints

Comments

@b-ncMN
Copy link
Contributor

b-ncMN commented Apr 24, 2022

What it does

The lint already exists but it needs an improvement in the way it detects temporaries :
Currently, it matches a DefId against &["core", "option", "Option", "as_ref"], while this works, this can give false negatives on temporary bindings.
The way we want that to work instead is described here : #8665 (comment)

Upstream PR introducing the initial lint : #8665

Lint Name

needless_option_take

Category

complexity

Advantage

No response

Drawbacks

No response

Example

<code>

Could be written as:

<code>
@b-ncMN b-ncMN added the A-lint Area: New lints label Apr 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

No branches or pull requests

1 participant