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

Make unnecessary_map_or work with ref and Deref to Option/Result #14024

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

samueltardieu
Copy link
Contributor

Receivers which are references to Option and Result, or who implement Deref to one of those types, will be linted as well.

changelog: [unnecessary_map_or]: work with ref and Deref to Option and Result as well

Fixes #14023

Note: this patch must be merged after #13998 – only the second commit must be reviewed, the first one repeats the patch in #13998 for mergeability reasons.

@rustbot
Copy link
Collaborator

rustbot commented Jan 18, 2025

r? @blyxyas

rustbot has assigned @blyxyas.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 18, 2025
A multipart suggestion will be used whenever the method call can be
replaced by another one with the first argument removed. It helps place
the new method call in context, especially when it is part of a larger
expression.
Receivers which are references to `Option` and `Result`, or who
implement `Deref` to one of those types, will be linted as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option::is_none_or: unnecessary_map_or lint doesn't work on references
3 participants