Remove a wildcard parttern from slice patterns
This commit is contained in:
parent
996dbbf960
commit
934cf2807d
1 changed files with 2 additions and 1 deletions
|
|
@ -144,7 +144,8 @@ impl Rewrite for Pat {
|
|||
let prefix = prefix.iter().map(|p| p.rewrite(context, shape));
|
||||
let slice_pat = slice_pat
|
||||
.as_ref()
|
||||
.map(|p| Some(format!("{}..", p.rewrite(context, shape)?)));
|
||||
.and_then(|p| p.rewrite(context, shape))
|
||||
.map(|rw| Some(format!("{}..", if rw == "_" { "" } else { &rw })));
|
||||
let suffix = suffix.iter().map(|p| p.rewrite(context, shape));
|
||||
|
||||
// Munge them together.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue