File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -2026,7 +2026,7 @@ impl Clean<Item> for doctree::Variant {
2026
2026
deprecation : self . depr . clean ( cx) ,
2027
2027
def_id : cx. map . local_def_id ( self . def . id ( ) ) ,
2028
2028
inner : VariantItem ( Variant {
2029
- kind : struct_def_to_variant_kind ( & self . def , cx) ,
2029
+ kind : VariantKind :: from_struct_def ( & self . def , cx) ,
2030
2030
} ) ,
2031
2031
}
2032
2032
}
@@ -2080,13 +2080,15 @@ pub enum VariantKind {
2080
2080
StructVariant ( VariantStruct ) ,
2081
2081
}
2082
2082
2083
- fn struct_def_to_variant_kind ( struct_def : & hir:: VariantData , cx : & DocContext ) -> VariantKind {
2084
- if struct_def. is_struct ( ) {
2085
- StructVariant ( struct_def. clean ( cx) )
2086
- } else if struct_def. is_unit ( ) {
2087
- CLikeVariant
2088
- } else {
2089
- TupleVariant ( struct_def. fields ( ) . iter ( ) . map ( |x| x. ty . clean ( cx) ) . collect ( ) )
2083
+ impl VariantKind {
2084
+ fn from_struct_def ( struct_def : & hir:: VariantData , cx : & DocContext ) -> VariantKind {
2085
+ if struct_def. is_struct ( ) {
2086
+ StructVariant ( struct_def. clean ( cx) )
2087
+ } else if struct_def. is_unit ( ) {
2088
+ CLikeVariant
2089
+ } else {
2090
+ TupleVariant ( struct_def. fields ( ) . iter ( ) . map ( |x| x. ty . clean ( cx) ) . collect ( ) )
2091
+ }
2090
2092
}
2091
2093
}
2092
2094
You can’t perform that action at this time.
0 commit comments