Some variants can have a common field wrapped in an Option.
So, for example:
enum MyEnum {
A { name: String },
B,
C { name: Option<String> },
}
I expect .name() to work and return an Option<String>. However, we get an error because not all variants have the same type for the name field.
Instead, it would be nice to detect this case and append a .flatten() to the accessor.
Super useful crate. I'm surprised it isn't more popular
Some variants can have a common field wrapped in an
Option.So, for example:
I expect
.name()to work and return anOption<String>. However, we get an error because not all variants have the same type for thenamefield.Instead, it would be nice to detect this case and append a
.flatten()to the accessor.Super useful crate. I'm surprised it isn't more popular