File tree Expand file tree Collapse file tree 4 files changed +25
-30
lines changed Expand file tree Collapse file tree 4 files changed +25
-30
lines changed Original file line number Diff line number Diff line change @@ -1034,11 +1034,10 @@ impl<'a> ControlFlow<'a> {
1034
1034
let trial = self . rewrite_single_line ( & pat_expr_string, context, shape. width ) ;
1035
1035
1036
1036
if let Some ( cond_str) = trial {
1037
- if cond_str. len ( )
1038
- <= context
1039
- . config
1040
- . width_heuristics ( )
1041
- . single_line_if_else_max_width
1037
+ if cond_str. len ( ) <= context
1038
+ . config
1039
+ . width_heuristics ( )
1040
+ . single_line_if_else_max_width
1042
1041
{
1043
1042
return Some ( ( cond_str, 0 ) ) ;
1044
1043
}
Original file line number Diff line number Diff line change @@ -84,10 +84,9 @@ impl ListItem {
84
84
}
85
85
86
86
pub fn is_different_group ( & self ) -> bool {
87
- self . inner_as_ref ( ) . contains ( '\n' ) || self . pre_comment . is_some ( )
88
- || self . post_comment
89
- . as_ref ( )
90
- . map_or ( false , |s| s. contains ( '\n' ) )
87
+ self . inner_as_ref ( ) . contains ( '\n' ) || self . pre_comment . is_some ( ) || self . post_comment
88
+ . as_ref ( )
89
+ . map_or ( false , |s| s. contains ( '\n' ) )
91
90
}
92
91
93
92
pub fn is_multiline ( & self ) -> bool {
Original file line number Diff line number Diff line change @@ -666,22 +666,20 @@ fn indent_macro_snippet(
666
666
. min ( ) ?;
667
667
668
668
Some (
669
- String :: from ( first_line) + "\n "
670
- + & trimmed_lines
671
- . iter ( )
672
- . map ( |& ( line, prefix_space_width) | match prefix_space_width {
673
- Some ( original_indent_width) => {
674
- let new_indent_width = indent. width ( )
675
- + original_indent_width
676
- . checked_sub ( min_prefix_space_width)
677
- . unwrap_or ( 0 ) ;
678
- let new_indent = Indent :: from_width ( context. config , new_indent_width) ;
679
- format ! ( "{}{}" , new_indent. to_string( context. config) , line. trim( ) )
680
- }
681
- None => String :: new ( ) ,
682
- } )
683
- . collect :: < Vec < _ > > ( )
684
- . join ( "\n " ) ,
669
+ String :: from ( first_line) + "\n " + & trimmed_lines
670
+ . iter ( )
671
+ . map ( |& ( line, prefix_space_width) | match prefix_space_width {
672
+ Some ( original_indent_width) => {
673
+ let new_indent_width = indent. width ( ) + original_indent_width
674
+ . checked_sub ( min_prefix_space_width)
675
+ . unwrap_or ( 0 ) ;
676
+ let new_indent = Indent :: from_width ( context. config , new_indent_width) ;
677
+ format ! ( "{}{}" , new_indent. to_string( context. config) , line. trim( ) )
678
+ }
679
+ None => String :: new ( ) ,
680
+ } )
681
+ . collect :: < Vec < _ > > ( )
682
+ . join ( "\n " ) ,
685
683
)
686
684
}
687
685
Original file line number Diff line number Diff line change @@ -278,11 +278,10 @@ pub fn mk_sp(lo: BytePos, hi: BytePos) -> Span {
278
278
// Return true if the given span does not intersect with file lines.
279
279
macro_rules! out_of_file_lines_range {
280
280
( $self: ident, $span: expr) => {
281
- !$self. config. file_lines( ) . is_all( )
282
- && !$self
283
- . config
284
- . file_lines( )
285
- . intersects( & $self. codemap. lookup_line_range( $span) )
281
+ !$self. config. file_lines( ) . is_all( ) && !$self
282
+ . config
283
+ . file_lines( )
284
+ . intersects( & $self. codemap. lookup_line_range( $span) )
286
285
} ;
287
286
}
288
287
You can’t perform that action at this time.
0 commit comments