Merge pull request #1875 from topecongiro/empty-tuple-pattern

Allow empty tuple pattern
This commit is contained in:
Nick Cameron
2017-08-14 11:05:39 +12:00
committed by GitHub
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -288,7 +288,7 @@ fn rewrite_tuple_pat(
}
if pat_vec.is_empty() {
return Some(format!("{}()", try_opt!(path_str)));
return Some(format!("{}()", path_str.unwrap_or(String::new())));
}
let wildcard_suffix_len = count_wildcard_suffix_len(context, &pat_vec, span, shape);
+6
View File
@@ -42,3 +42,9 @@ fn mutate_fragment(&mut self, fragment: &mut Fragment) {
fn issue_1319() {
if let (Event { .. }, .. ) = ev_state {}
}
fn issue_1874() {
if let Some(()) = x {
y
}
}
+6
View File
@@ -57,3 +57,9 @@ fn mutate_fragment(&mut self, fragment: &mut Fragment) {
fn issue_1319() {
if let (Event { .. }, ..) = ev_state {}
}
fn issue_1874() {
if let Some(()) = x {
y
}
}