File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed
rustfmt-core/rustfmt-lib/src Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -42,17 +42,6 @@ impl Rewrite for ast::Expr {
4242 }
4343}
4444
45- impl Rewrite for Option < ptr:: P < ast:: Expr > > {
46- fn rewrite ( & self , context : & RewriteContext < ' _ > , shape : Shape ) -> Option < String > {
47- match & self {
48- None => Some ( "" . to_owned ( ) ) ,
49- Some ( ref exp) => {
50- exp. rewrite ( context, shape)
51- }
52- }
53- }
54- }
55-
5645#[ derive( Copy , Clone , PartialEq ) ]
5746pub ( crate ) enum ExprType {
5847 Statement ,
Original file line number Diff line number Diff line change @@ -180,6 +180,16 @@ impl Rewrite for Pat {
180180 }
181181 }
182182 PatKind :: Range ( ref lhs, ref rhs, ref end_kind) => {
183+ impl Rewrite for Option < ptr:: P < ast:: Expr > > {
184+ fn rewrite ( & self , context : & RewriteContext < ' _ > , shape : Shape ) -> Option < String > {
185+ match & self {
186+ None => Some ( "" . to_owned ( ) ) ,
187+ Some ( ref exp) => {
188+ exp. rewrite ( context, shape)
189+ }
190+ }
191+ }
192+ }
183193 let infix = match end_kind. node {
184194 RangeEnd :: Included ( RangeSyntax :: DotDotDot ) => "..." ,
185195 RangeEnd :: Included ( RangeSyntax :: DotDotEq ) => "..=" ,
You can’t perform that action at this time.
0 commit comments