@@ -1109,7 +1109,7 @@ struct StructMemberDescriptionFactory<'tcx> {
1109
1109
impl < ' tcx > StructMemberDescriptionFactory < ' tcx > {
1110
1110
fn create_member_descriptions < ' a > ( & self , cx : & CrateContext < ' a , ' tcx > )
1111
1111
-> Vec < MemberDescription > {
1112
- if let ty:: VariantKind :: Unit = self . variant . kind ( ) {
1112
+ if self . variant . kind == ty:: VariantKind :: Unit {
1113
1113
return Vec :: new ( ) ;
1114
1114
}
1115
1115
@@ -1126,7 +1126,7 @@ impl<'tcx> StructMemberDescriptionFactory<'tcx> {
1126
1126
} ;
1127
1127
1128
1128
self . variant . fields . iter ( ) . enumerate ( ) . map ( |( i, f) | {
1129
- let name = if let ty:: VariantKind :: Tuple = self . variant . kind ( ) {
1129
+ let name = if self . variant . kind == ty:: VariantKind :: Tuple {
1130
1130
format ! ( "__{}" , i)
1131
1131
} else {
1132
1132
f. name . to_string ( )
@@ -1356,7 +1356,7 @@ impl<'tcx> EnumMemberDescriptionFactory<'tcx> {
1356
1356
// For the metadata of the wrapper struct, we need to create a
1357
1357
// MemberDescription of the struct's single field.
1358
1358
let sole_struct_member_description = MemberDescription {
1359
- name : match non_null_variant. kind ( ) {
1359
+ name : match non_null_variant. kind {
1360
1360
ty:: VariantKind :: Tuple => "__0" . to_string ( ) ,
1361
1361
ty:: VariantKind :: Struct => {
1362
1362
non_null_variant. fields [ 0 ] . name . to_string ( )
@@ -1524,7 +1524,7 @@ fn describe_enum_variant<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
1524
1524
containing_scope) ;
1525
1525
1526
1526
// Get the argument names from the enum variant info
1527
- let mut arg_names: Vec < _ > = match variant. kind ( ) {
1527
+ let mut arg_names: Vec < _ > = match variant. kind {
1528
1528
ty:: VariantKind :: Unit => vec ! [ ] ,
1529
1529
ty:: VariantKind :: Tuple => {
1530
1530
variant. fields
0 commit comments