Replace an unnecessary slice pattern with has_dot_dot: bool
This commit is contained in:
parent
4cd800503f
commit
e98e19e491
2 changed files with 10 additions and 14 deletions
|
@ -872,7 +872,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> {
|
|||
match slice.kind {
|
||||
SliceKind::FixedLen(_) => PatKind::Slice {
|
||||
prefix: subpatterns.collect(),
|
||||
slice: None,
|
||||
has_dot_dot: false,
|
||||
suffix: Box::new([]),
|
||||
},
|
||||
SliceKind::VarLen(prefix, _) => {
|
||||
|
@ -893,10 +893,9 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> {
|
|||
}
|
||||
}
|
||||
let suffix: Box<[_]> = subpatterns.collect();
|
||||
let wild = Pat { ty: pat.ty().inner(), kind: PatKind::Wild };
|
||||
PatKind::Slice {
|
||||
prefix: prefix.into_boxed_slice(),
|
||||
slice: Some(Box::new(wild)),
|
||||
has_dot_dot: true,
|
||||
suffix,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue