Remove a wildcard parttern from slice patterns

This commit is contained in:
Seiichi Uchida 2018-08-12 23:56:09 +09:00
parent 996dbbf960
commit 934cf2807d

View file

@ -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.