Combine PatKind::TupleStruct

This commit is contained in:
topecongiro 2017-11-02 20:29:10 +09:00
parent dc035bbbee
commit 87afdf4467

View File

@ -247,9 +247,10 @@ impl<'a> Spanned for TuplePatField<'a> {
pub fn can_be_overflowed_pat(context: &RewriteContext, pat: &TuplePatField, len: usize) -> bool {
match *pat {
TuplePatField::Pat(pat) => match pat.node {
ast::PatKind::Path(..) | ast::PatKind::Tuple(..) | ast::PatKind::Struct(..) => {
context.use_block_indent() && len == 1
}
ast::PatKind::Path(..) |
ast::PatKind::Tuple(..) |
ast::PatKind::Struct(..) |
ast::PatKind::TupleStruct(..) => context.use_block_indent() && len == 1,
ast::PatKind::Ref(ref p, _) | ast::PatKind::Box(ref p) => {
can_be_overflowed_pat(context, &TuplePatField::Pat(p), len)
}