File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -383,15 +383,14 @@ fn take_pat(from: &mut Pat) -> Pat {
383
383
/// in `tail_or` if there are any and return if there were.
384
384
fn extend_with_tail_or ( target : & mut Pat , tail_or : ThinVec < Box < Pat > > ) -> bool {
385
385
fn extend ( target : & mut Pat , mut tail_or : ThinVec < Box < Pat > > ) {
386
- match & mut target. kind {
387
- // On an existing or-pattern in the target, append to it.
388
- Or ( ps) => ps. append ( & mut tail_or) ,
389
- // Otherwise convert the target to an or-pattern.
390
- _ => {
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) ;
394
- } ,
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) ;
395
394
}
396
395
}
397
396
You can’t perform that action at this time.
0 commit comments