Add support for destructuring vectors in match expressions
This commit is contained in:
committed by
Graydon Hoare
parent
5bf7ba0773
commit
1968cb315a
@@ -593,6 +593,14 @@ fn walk_pat(pat: @pat, it: fn(@pat)) {
|
||||
pat_box(s) | pat_uniq(s) | pat_region(s) => {
|
||||
walk_pat(s, it)
|
||||
}
|
||||
pat_vec(elts, tail) => {
|
||||
for elts.each |p| {
|
||||
walk_pat(*p, it)
|
||||
}
|
||||
do option::iter(&tail) |tail| {
|
||||
walk_pat(*tail, it)
|
||||
}
|
||||
}
|
||||
pat_wild | pat_lit(_) | pat_range(_, _) | pat_ident(_, _, _) |
|
||||
pat_enum(_, _) => {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user