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

Improve span of or_fun_call lint #9033

Closed
flip1995 opened this issue Jun 22, 2022 · 1 comment · Fixed by #9144
Closed

Improve span of or_fun_call lint #9033

flip1995 opened this issue Jun 22, 2022 · 1 comment · Fixed by #9144
Assignees
Labels
good-first-issue These issues are a good way to get started with Clippy L-suggestion Lint: Improving, adding or fixing lint suggestions

Comments

@flip1995
Copy link
Member

flip1995 commented Jun 22, 2022

Description

The lint message currently spans through the entire method chain expression:

error: use of `unwrap_or` followed by a call to `new`
  --> $DIR/or_fun_call.rs:182:9
   |
LL | /         frames
LL | |             .iter()
LL | |             .map(|f: &String| f.to_lowercase())
LL | |             .reduce(|mut acc, f| {
...  |
LL | |             })
LL | |             .unwrap_or(String::new());
   | |_____________________________________^

It would be enough to just point to the unwrap_or.

Originally posted by @flip1995 in rust-lang/rust#98261 (comment)

Version

No response

Additional Labels

No response

@flip1995 flip1995 added good-first-issue These issues are a good way to get started with Clippy L-suggestion Lint: Improving, adding or fixing lint suggestions labels Jun 22, 2022
@alex-semenyuk
Copy link
Member

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue These issues are a good way to get started with Clippy L-suggestion Lint: Improving, adding or fixing lint suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants