Skip to content

Do not add parentheses when completing functions in closures without parameters #3148

@SomeoneToIgnore

Description

@SomeoneToIgnore
fn multiply_by_2(input: u32) -> u32 {
    input * 2
}

fn main() {
    let initial = Some(22);
    let multiplied = initial.map(mul<|>);
}

Do a completion.

Expected:

fn multiply_by_2(input: u32) -> u32 {
    input * 2
}

fn main() {
    let initial = Some(22);
    let multiplied = initial.map(multiply_by_2<|>);
}

Actual:

fn multiply_by_2(input: u32) -> u32 {
    input * 2
}

fn main() {
    let initial = Some(22);
    let multiplied = initial.map(multiply_by_2(<|>));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-completionautocompletionS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions