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:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user