Skip to content

Commit adf38c0

Browse files
committed
match on kind directly
this destructuring is.. a bit weird
1 parent 34abe4e commit adf38c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/unnested_or_patterns.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,11 +385,11 @@ fn take_pat(from: &mut Pat) -> Pat {
385385
/// in `tail_or` if there are any and return if there were.
386386
fn 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 target {
388+
match &mut target.kind {
389389
// On an existing or-pattern in the target, append to it.
390-
Pat { kind: Or(ps), .. } => ps.append(&mut tail_or),
390+
Or(ps) => ps.append(&mut tail_or),
391391
// Otherwise convert the target to an or-pattern.
392-
target => {
392+
_ => {
393393
let mut init_or = thin_vec![take_pat(target)];
394394
init_or.append(&mut tail_or);
395395
target.kind = Or(init_or);

0 commit comments

Comments
 (0)