File tree 1 file changed +13
-12
lines changed
1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -1063,18 +1063,19 @@ impl Item {
1063
1063
1064
1064
/// Returns a prefix for the canonical name when C naming is enabled.
1065
1065
fn c_naming_prefix ( & self ) -> Option < & str > {
1066
- if let ItemKind :: Type ( typ) = & self . kind {
1067
- match typ. kind ( ) {
1068
- TypeKind :: Comp ( comp_info) => match comp_info. kind ( ) {
1069
- CompKind :: Struct => Some ( "struct" ) ,
1070
- CompKind :: Union => Some ( "union" ) ,
1071
- } ,
1072
- TypeKind :: Enum ( _) => Some ( "enum" ) ,
1073
- _ => None ,
1074
- }
1075
- } else {
1076
- None
1077
- }
1066
+ let ty = match self . kind {
1067
+ ItemKind :: Type ( ref ty) => ty,
1068
+ _ => return None ,
1069
+ } ;
1070
+
1071
+ Some ( match ty. kind ( ) {
1072
+ TypeKind :: Comp ( ref ci) => match ci. kind ( ) {
1073
+ CompKind :: Struct => "struct" ,
1074
+ CompKind :: Union => "union" ,
1075
+ } ,
1076
+ TypeKind :: Enum ( ..) => "enum" ,
1077
+ _ => return None ,
1078
+ } )
1078
1079
}
1079
1080
}
1080
1081
You can’t perform that action at this time.
0 commit comments