While I see that derive-new can create a collection of constructors for enum variants, it would be convenient for enums that always have a single new constructor, like this:
#[derive(new)]
enum Foo {
#[new]
InitialState { data: String },
SecondState{ data: Vec<u8> }
}
// Produces:
fn new(data: String) -> Foo { Foo::InitialState{data}}
While I see that
derive-newcan create a collection of constructors for enum variants, it would be convenient for enums that always have a singlenewconstructor, like this: