Skip to content

Commit

Permalink
Fix unit variants with a value (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
parasyte committed Apr 17, 2023
1 parent c895cbe commit f646724
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ impl Variant {

ty
} else {
// Unit variants can have an optional value.
let _ = input.as_punct();
let _ = input.as_lit();

VariantType::Unit
};

Expand Down

0 comments on commit f646724

Please sign in to comment.