Skip to content

Improve span of or_fun_call lint #9033

Closed
@flip1995

Description

@flip1995

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

Metadata

Metadata

Assignees

Labels

L-suggestionLint: Improving, adding or fixing lint suggestionsgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions