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

Use clearer multipart suggestions for unnecessary_map_or lint #13998

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

samueltardieu
Copy link
Contributor

@samueltardieu samueltardieu commented Jan 14, 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.

This fixes #13995 by applying a suggestion made by @y21.

r? @y21

changelog: [unnecessary_map_or]: better representation of suggestions by placing them in context

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 14, 2025
clippy_lints/src/methods/unnecessary_map_or.rs Outdated Show resolved Hide resolved
clippy_lints/src/methods/unnecessary_map_or.rs Outdated Show resolved Hide resolved
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.
Copy link
Member

@y21 y21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for implementing the suggestion, looks good :3

@y21 y21 added this pull request to the merge queue Jan 19, 2025
Merged via the queue into rust-lang:master with commit 2280b8a Jan 19, 2025
11 checks passed
@samueltardieu samueltardieu deleted the push-qkotxpksznsl branch January 22, 2025 17:49
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.

Improve unnecessary_map_or lint with negated expressions
3 participants