Skip to content

[FR] Code action: expand || into inferred closure params/return type at call site (e.g. |a: u64| -> u32 { … }) #20775

@eval-exec

Description

@eval-exec

Hello,

Do you think rust-analyzer can have this?

fn main(){
    // I write, and put cursor after ||
    here(||);
    // Then I want to rust-analyzer's code-action convert above line code to bellow code:
    here(|a:u64|-> u32 {
        
    });
}

fn here<F>(a: F)
where
    F: FnOnce(u64) -> u32,
{
    todo!()
}

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions