Skip to content

Commit

Permalink
fix derive macro panic
Browse files Browse the repository at this point in the history
  • Loading branch information
msrd0 committed Feb 4, 2022
1 parent 8aeaeda commit 002db8d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions derive/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,11 @@ pub(super) fn parse_enum(ident: &Ident, inum: &DataEnum, attrs: &ContainerAttrib

match (data_strings, data_types) {
// only variants without fields
(Some(ParseDataType::Enum { variants }), None) => Ok(ParseData {
(Some(ty), None) => Ok(ParseData {
name: Some(ident.to_lit_str()),
doc: attrs.doc.clone(),
ty: ParseDataType::Enum { variants }
ty
}),
(Some(_), None) => unreachable!(),
// only one variant with fields
(
None,
Expand Down

0 comments on commit 002db8d

Please sign in to comment.