File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ fn is_short_pattern_inner(pat: &ast::Pat) -> bool {
48
48
| ast:: PatKind :: MacCall ( ..)
49
49
| ast:: PatKind :: Slice ( ..)
50
50
| ast:: PatKind :: Path ( ..)
51
- | ast:: PatKind :: Range ( ..) => false ,
51
+ | ast:: PatKind :: Range ( ..)
52
+ | ast:: PatKind :: Guard ( ..) => false ,
52
53
ast:: PatKind :: Tuple ( ref subpats) => subpats. len ( ) <= 1 ,
53
54
ast:: PatKind :: TupleStruct ( _, ref path, ref subpats) => {
54
55
path. segments . len ( ) <= 1 && subpats. len ( ) <= 1
@@ -340,6 +341,7 @@ impl Rewrite for Pat {
340
341
. map ( |inner_pat| format ! ( "({})" , inner_pat) ) ,
341
342
PatKind :: Err ( _) => Err ( RewriteError :: Unknown ) ,
342
343
PatKind :: Deref ( _) => Err ( RewriteError :: Unknown ) ,
344
+ PatKind :: Guard ( ..) => Err ( RewriteError :: Unknown ) ,
343
345
}
344
346
}
345
347
}
You can’t perform that action at this time.
0 commit comments