File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -55,9 +55,10 @@ fn is_short_pattern_inner(pat: &ast::Pat) -> bool {
5555 ast:: PatKind :: TupleStruct ( _, ref path, ref subpats) => {
5656 path. segments . len ( ) <= 1 && subpats. len ( ) <= 1
5757 }
58- ast:: PatKind :: Box ( ref p) | ast:: PatKind :: Ref ( ref p, _) | ast:: PatKind :: Paren ( ref p) => {
59- is_short_pattern_inner ( & * p)
60- }
58+ ast:: PatKind :: Box ( ref p)
59+ | PatKind :: Deref ( ref p)
60+ | ast:: PatKind :: Ref ( ref p, _)
61+ | ast:: PatKind :: Paren ( ref p) => is_short_pattern_inner ( & * p) ,
6162 PatKind :: Or ( ref pats) => pats. iter ( ) . all ( |p| is_short_pattern_inner ( p) ) ,
6263 }
6364}
@@ -277,6 +278,7 @@ impl Rewrite for Pat {
277278 . rewrite ( context, shape. offset_left ( 1 ) ?. sub_width ( 1 ) ?)
278279 . map ( |inner_pat| format ! ( "({})" , inner_pat) ) ,
279280 PatKind :: Err ( _) => None ,
281+ PatKind :: Deref ( _) => None ,
280282 }
281283 }
282284}
You can’t perform that action at this time.
0 commit comments