Skip to content

Extract enum variant #31

@nrc

Description

@nrc

Most useful for structs, the tuple case is not so important. E.g.,

enum Foo {
    Foo,
    Bar { a: A, b: B },
    Baz(A, B)
}

to

enum Foo {
    Foo,
    Bar(Bar),
    Baz(Baz)
}

pub struct Bar {
    a: A,
    b: B,
}

type Baz = (A, B);

I guess there should be a collapse case too, but that seems less useful. The fun part of this will be getting the pattern matching right.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions