File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ 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 :: Wild | ast:: PatKind :: Lit ( _) => true ,
43+ ast:: PatKind :: Rest | ast:: PatKind :: Never | ast:: PatKind :: Wild | ast:: PatKind :: Lit ( _) => {
44+ true
45+ }
4446 ast:: PatKind :: Ident ( _, _, ref pat) => pat. is_none ( ) ,
4547 ast:: PatKind :: Struct ( ..)
4648 | ast:: PatKind :: MacCall ( ..)
@@ -193,6 +195,7 @@ impl Rewrite for Pat {
193195 None
194196 }
195197 }
198+ PatKind :: Never => None ,
196199 PatKind :: Range ( ref lhs, ref rhs, ref end_kind) => {
197200 let infix = match end_kind. node {
198201 RangeEnd :: Included ( RangeSyntax :: DotDotDot ) => "..." ,
You can’t perform that action at this time.
0 commit comments