Skip to content

Suggest changing closure on E0593 #52473

Closed
@estebank

Description

@estebank
Contributor

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?

Activity

self-assigned this
on Jul 23, 2018
added a commit that references this issue on Jul 26, 2018

Rollup merge of rust-lang#52647 - csmoe:closure_arg_ignore, r=estebank

662fb06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Participants

      @estebank@csmoe

      Issue actions

        Suggest changing closure on E0593 · Issue #52473 · rust-lang/rust