Bring enum variants in scope for patterns

I have an alternative suggestion for solving this problem - teach people how to use column editing in their editor.

column-editing

With this power complexity of writing

MyEnum::VariantA
MyEnum::VariantB
MyEnum::VariantC
MyEnum::VariantD

and

Self::VariantA
Self::VariantB
Self::VariantC
Self::VariantD

and

_::VariantA
_::VariantB
_::VariantC
_::VariantD

becomes identical.

As a result you can easily start preferring the first variant because it's the only variant that is not write-only.

3 Likes