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 @@ -385,15 +385,14 @@ fn take_pat(from: &mut Pat) -> Pat {
385385/// in `tail_or` if there are any and return if there were.
386386fn extend_with_tail_or ( target : & mut Pat , tail_or : ThinVec < Pat > ) -> bool {
387387 fn extend ( target : & mut Pat , mut tail_or : ThinVec < Pat > ) {
388- match & mut target. kind {
389- // On an existing or-pattern in the target, append to it.
390- Or ( ps) => ps. append ( & mut tail_or) ,
391- // Otherwise convert the target to an or-pattern.
392- _ => {
393- let mut init_or = thin_vec ! [ take_pat( target) ] ;
394- init_or. append ( & mut tail_or) ;
395- target. kind = Or ( init_or) ;
396- } ,
388+ // On an existing or-pattern in the target, append to it,
389+ // otherwise convert the target to an or-pattern.
390+ if let Or ( ps) = & mut target. kind {
391+ ps. append ( & mut tail_or) ;
392+ } else {
393+ let mut init_or = thin_vec ! [ take_pat( target) ] ;
394+ init_or. append ( & mut tail_or) ;
395+ target. kind = Or ( init_or) ;
397396 }
398397 }
399398
You can’t perform that action at this time.
0 commit comments