File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,11 @@ pub(crate) fn is_short_pattern(pat: &ast::Pat, pat_str: &str) -> bool {
4040
4141fn is_short_pattern_inner ( pat : & ast:: Pat ) -> bool {
4242 match pat. kind {
43- ast:: PatKind :: Rest | ast:: PatKind :: Never | ast:: PatKind :: Wild | ast:: PatKind :: Lit ( _) => {
44- true
45- }
43+ ast:: PatKind :: Rest
44+ | ast:: PatKind :: Never
45+ | ast:: PatKind :: Wild
46+ | ast:: PatKind :: Err ( _)
47+ | ast:: PatKind :: Lit ( _) => true ,
4648 ast:: PatKind :: Ident ( _, _, ref pat) => pat. is_none ( ) ,
4749 ast:: PatKind :: Struct ( ..)
4850 | ast:: PatKind :: MacCall ( ..)
@@ -274,6 +276,7 @@ impl Rewrite for Pat {
274276 PatKind :: Paren ( ref pat) => pat
275277 . rewrite ( context, shape. offset_left ( 1 ) ?. sub_width ( 1 ) ?)
276278 . map ( |inner_pat| format ! ( "({})" , inner_pat) ) ,
279+ PatKind :: Err ( _) => None ,
277280 }
278281 }
279282}
You can’t perform that action at this time.
0 commit comments