Skip to content

Commit 9d6684c

Browse files
committed
Introduce 'ast::Pat::is_rest(&self) -> bool'.
1 parent 5d11755 commit 9d6684c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libsyntax/ast.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,14 @@ impl Pat {
580580
| PatKind::Mac(_) => true,
581581
}
582582
}
583+
584+
/// Is this a `..` pattern?
585+
pub fn is_rest(&self) -> bool {
586+
match self.node {
587+
PatKind::Rest => true,
588+
_ => false,
589+
}
590+
}
583591
}
584592

585593
/// A single field in a struct pattern

0 commit comments

Comments
 (0)