@@ -12,13 +12,15 @@ use crate::lists::{
1212use crate :: macros:: { MacroPosition , rewrite_macro} ;
1313use crate :: overflow;
1414use crate :: pairs:: { PairParts , rewrite_pair} ;
15+ use crate :: range:: rewrite_range;
1516use crate :: rewrite:: { Rewrite , RewriteContext , RewriteError , RewriteErrorExt , RewriteResult } ;
1617use crate :: shape:: Shape ;
1718use crate :: source_map:: SpanUtils ;
1819use crate :: spanned:: Spanned ;
1920use crate :: types:: { PathContext , rewrite_path} ;
2021use crate :: utils:: {
21- format_mutability, format_pinnedness_and_mutability, mk_sp, mk_sp_lo_plus_one, rewrite_ident,
22+ format_mutability, format_pinnedness_and_mutability, format_range_end, mk_sp,
23+ mk_sp_lo_plus_one, rewrite_ident,
2224} ;
2325
2426/// Returns `true` if the given pattern is "short".
@@ -291,9 +293,13 @@ impl Rewrite for Pat {
291293 }
292294 }
293295 PatKind :: Never => Err ( RewriteError :: Unknown ) ,
294- PatKind :: Range ( ref lhs, ref rhs, ref end_kind) => {
295- rewrite_range_pat ( context, shape, lhs, rhs, end_kind, self . span )
296- }
296+ PatKind :: Range ( ref lhs, ref rhs, ref end_kind) => rewrite_range (
297+ context,
298+ shape,
299+ lhs. as_deref ( ) ,
300+ rhs. as_deref ( ) ,
301+ format_range_end ( end_kind. node ) ,
302+ ) ,
297303 PatKind :: Ref ( ref pat, pinnedness, mutability) => {
298304 let ( pin_prefix, mut_prefix) =
299305 format_pinnedness_and_mutability ( pinnedness, mutability) ;
0 commit comments