Skip to content

Add an action to convert structure update syntax to explicit field passing #21736

@WaffleLapkin

Description

@WaffleLapkin

i.e. consider this:

fn f() {
    struct S { a: u8, b: u8, c: u8 }

    let s = S { a: 0, b: 1, c: 2 };
    let s = S { b: 4, ..s };
    //                ^^^ cursor somewhere here
}

==>>

fn f() {
    struct S { a: u8, b: u8, c: u8 }

    let s = S { a: 0, b: 1, c: 2 };
    let s = S { b: 4, a: s.a, c: s.c };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions