Skip to content

Commit

Permalink
Weaken requirements to a number of enum variants
Browse files Browse the repository at this point in the history
  • Loading branch information
blackbeam committed Sep 15, 2019
1 parent 10b33a9 commit b927c0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ impl EnumData {
E: MaybeEnum,
{
let elements = MaybeEnum::elements(maybe_enum)?;
if elements.variants.len() < 2 {
error!(maybe_enum, "cannot be implemented for enums with less than two variants");
if elements.variants.is_empty() {
error!(maybe_enum, "cannot be implemented for enums with no variants");
}

parse_variants(elements.variants).map(|(variants, fields)| Self {
Expand Down

0 comments on commit b927c0e

Please sign in to comment.