File tree 1 file changed +9
-12
lines changed 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -71,23 +71,20 @@ impl Enum {
71
71
} ;
72
72
73
73
declaration. visit ( |cursor| {
74
- let val = if is_signed {
75
- cursor. enum_val_signed ( ) . map ( EnumVariantValue :: Signed )
76
- } else {
77
- if cursor. kind ( ) == CXCursor_EnumConstantDecl {
78
- Some ( EnumVariantValue :: Unsigned ( cursor. enum_val_unsigned ( ) ) )
74
+ if cursor. kind ( ) == CXCursor_EnumConstantDecl {
75
+ let value = if is_signed {
76
+ cursor. enum_val_signed ( ) . map ( EnumVariantValue :: Signed )
79
77
} else {
80
- None
78
+ Some ( EnumVariantValue :: Unsigned ( cursor. enum_val_unsigned ( ) ) )
79
+ } ;
80
+ if let Some ( val) = value {
81
+ let name = cursor. spelling ( ) ;
82
+ let comment = cursor. raw_comment ( ) ;
83
+ variants. push ( EnumVariant :: new ( name, comment, val) ) ;
81
84
}
82
- } ;
83
- if let Some ( val) = val {
84
- let name = cursor. spelling ( ) ;
85
- let comment = cursor. raw_comment ( ) ;
86
- variants. push ( EnumVariant :: new ( name, comment, val) ) ;
87
85
}
88
86
CXChildVisit_Continue
89
87
} ) ;
90
-
91
88
Ok ( Enum :: new ( repr, variants) )
92
89
}
93
90
}
You can’t perform that action at this time.
0 commit comments