Skip to content

Better syntax for configuring #[derive(DefaultGenerator)] generators on enum tuple variants #149

@Liam-DeVoe

Description

@Liam-DeVoe

Right now, our customization for enum tuple variants looks like this:

#[derive(DeriveGenerator)]
enum A {
    B(i32),
    C(i32, i32)
}

let g = gs::default::<A>().B(
    A::default_generator()
        .default_B().value(gs::just(42))
);

And I don't believe we have any way to configure tuple variants with multiple fields.

We should fix both. I think the ideal syntax looks like gs::default::<A>().B(gs::just(42)) and gs::default::<A>().C(gs::just(42), gs::just(43)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementit's not broken, but we want it to be better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions