Skip to content

Suggest changing closure on E0593 #52473

Closed
@estebank

Description

@estebank

Given a call that expects a closure that accepts arguments being passed a closure that takes no arguments:

fn main() {
    Some(()).into_iter().filter(|| false).collect();
}

we might want to suggest modifying the closure to take the argument and ignore it:

fn main() {
    Some(()).into_iter().filter(|_| false).collect();
}

How often would this suggestion be inappropriate?

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lints

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions