Store pattern arity in DeconstructedPat

Right now this is just `self.fields.len()` but that'll change in the
next commit. `arity` will be useful for the `Debug` impl.
This commit is contained in:
Nadrieril
2024-02-29 23:34:52 +01:00
parent cd81f5b27e
commit c1e68860d0
3 changed files with 36 additions and 7 deletions

View File

@@ -423,7 +423,7 @@ pub enum SliceKind {
}
impl SliceKind {
fn arity(self) -> usize {
pub fn arity(self) -> usize {
match self {
FixedLen(length) => length,
VarLen(prefix, suffix) => prefix + suffix,
@@ -462,7 +462,7 @@ impl Slice {
Slice { array_len, kind }
}
pub(crate) fn arity(self) -> usize {
pub fn arity(self) -> usize {
self.kind.arity()
}