@@ -306,6 +306,7 @@ fn transform_with_focus_on_idx(alternatives: &mut ThinVec<Box<Pat>>, focus_idx:
306
306
/// In particular, for a record pattern, the order in which the field patterns is irrelevant.
307
307
/// So when we fixate on some `ident_k: pat_k`, we try to find `ident_k` in the other pattern
308
308
/// and check that all `fp_i` where `i ∈ ((0...n) \ k)` between two patterns are equal.
309
+ #[ expect( clippy:: borrowed_box, reason = "required by the signature of `eq_maybe_qself`" ) ]
309
310
fn extend_with_struct_pat (
310
311
qself1 : Option < & Box < ast:: QSelf > > ,
311
312
path1 : & ast:: Path ,
@@ -383,14 +384,15 @@ fn take_pat(from: &mut Pat) -> Pat {
383
384
/// in `tail_or` if there are any and return if there were.
384
385
fn extend_with_tail_or ( target : & mut Pat , tail_or : ThinVec < Box < Pat > > ) -> bool {
385
386
fn extend ( target : & mut Pat , mut tail_or : ThinVec < Box < Pat > > ) {
386
- // On an existing or-pattern in the target, append to it,
387
- // otherwise convert the target to an or-pattern.
388
- if let Or ( ps) = & mut target. kind {
389
- ps. append ( & mut tail_or) ;
390
- } else {
391
- let mut init_or = thin_vec ! [ Box :: new( take_pat( target) ) ] ;
392
- init_or. append ( & mut tail_or) ;
393
- target. kind = Or ( init_or) ;
387
+ match target {
388
+ // On an existing or-pattern in the target, append to it.
389
+ Pat { kind : Or ( ps) , .. } => ps. append ( & mut tail_or) ,
390
+ // Otherwise convert the target to an or-pattern.
391
+ target => {
392
+ let mut init_or = thin_vec ! [ Box :: new( take_pat( target) ) ] ;
393
+ init_or. append ( & mut tail_or) ;
394
+ target. kind = Or ( init_or) ;
395
+ } ,
394
396
}
395
397
}
396
398
0 commit comments