@@ -1198,10 +1198,7 @@ impl CodeGenerator for Vtable<'_> {
11981198 let function_item = ctx. resolve_item ( m. signature ( ) ) ;
11991199 let function = function_item. expect_function ( ) ;
12001200 let signature_item = ctx. resolve_item ( function. signature ( ) ) ;
1201- let signature = match signature_item. expect_type ( ) . kind ( ) {
1202- TypeKind :: Function ( ref sig) => sig,
1203- _ => panic ! ( "Function signature type mismatch" ) ,
1204- } ;
1201+ let TypeKind :: Function ( ref signature) = signature_item. expect_type ( ) . kind ( ) else { panic ! ( "Function signature type mismatch" ) } ;
12051202
12061203 // FIXME: Is there a canonical name without the class prepended?
12071204 let function_name = function_item. canonical_name ( ctx) ;
@@ -2974,20 +2971,18 @@ impl Method {
29742971 }
29752972 let function = function_item. expect_function ( ) ;
29762973 let times_seen = function. codegen ( ctx, result, function_item) ;
2977- let times_seen = match times_seen {
2978- Some ( seen) => seen,
2979- None => return ,
2980- } ;
2974+ let Some ( times_seen) = times_seen else { return } ;
29812975 let signature_item = ctx. resolve_item ( function. signature ( ) ) ;
29822976 let mut name = match self . kind ( ) {
29832977 MethodKind :: Constructor => "new" . into ( ) ,
29842978 MethodKind :: Destructor => "destruct" . into ( ) ,
29852979 _ => function. name ( ) . to_owned ( ) ,
29862980 } ;
29872981
2988- let signature = match * signature_item. expect_type ( ) . kind ( ) {
2989- TypeKind :: Function ( ref sig) => sig,
2990- _ => panic ! ( "How in the world?" ) ,
2982+ let TypeKind :: Function ( ref signature) =
2983+ * signature_item. expect_type ( ) . kind ( )
2984+ else {
2985+ panic ! ( "How in the world?" )
29912986 } ;
29922987
29932988 let supported_abi = signature. abi ( ctx, Some ( & * name) ) . is_ok ( ) ;
@@ -4488,9 +4483,8 @@ impl CodeGenerator for Function {
44884483
44894484 let signature_item = ctx. resolve_item ( self . signature ( ) ) ;
44904485 let signature = signature_item. kind ( ) . expect_type ( ) . canonical_type ( ctx) ;
4491- let signature = match * signature. kind ( ) {
4492- TypeKind :: Function ( ref sig) => sig,
4493- _ => panic ! ( "Signature kind is not a Function: {signature:?}" ) ,
4486+ let TypeKind :: Function ( ref signature) = * signature. kind ( ) else {
4487+ panic ! ( "Signature kind is not a Function: {signature:?}" )
44944488 } ;
44954489
44964490 if is_internal {
@@ -4966,9 +4960,8 @@ impl CodeGenerator for ObjCInterface {
49664960 . expect_type ( )
49674961 . kind ( ) ;
49684962
4969- let parent = match parent {
4970- TypeKind :: ObjCInterface ( ref parent) => parent,
4971- _ => break ,
4963+ let TypeKind :: ObjCInterface ( parent) = parent else {
4964+ break ;
49724965 } ;
49734966 parent_class = parent. parent_class ;
49744967
0 commit comments