@@ -32,8 +32,8 @@ use crate::string::{StringFormat, rewrite_string};
3232use crate :: types:: { PathContext , rewrite_path} ;
3333use crate :: utils:: {
3434 colon_spaces, contains_skip, count_newlines, filtered_str_fits, first_line_ends_with,
35- inner_attributes, is_absolute_decl_path, last_line_extendable, last_line_width, mk_sp, outer_attributes ,
36- semicolon_for_expr, unicode_str_width, wrap_str,
35+ inner_attributes, is_absolute_decl_path, last_line_extendable, last_line_width, mk_sp,
36+ outer_attributes , semicolon_for_expr, unicode_str_width, wrap_str,
3737} ;
3838use crate :: vertical:: rewrite_with_alignment;
3939use crate :: visitor:: FmtVisitor ;
@@ -1887,7 +1887,9 @@ pub(crate) fn struct_lit_field_separator(config: &Config, force_space_after_colo
18871887fn extract_ast_path_from_expr ( expr : & ast:: Expr ) -> Option < & ast:: Path > {
18881888 match & expr. kind {
18891889 ast:: ExprKind :: Call ( ptr_expr, ..) => extract_ast_path_from_expr ( & * ptr_expr) ,
1890- ast:: ExprKind :: MethodCall ( box_method_call, ..) => extract_ast_path_from_expr ( & * box_method_call. receiver ) ,
1890+ ast:: ExprKind :: MethodCall ( box_method_call, ..) => {
1891+ extract_ast_path_from_expr ( & * box_method_call. receiver )
1892+ }
18911893 ast:: ExprKind :: Binary ( _, left_expr, ..) => extract_ast_path_from_expr ( & * left_expr) ,
18921894 ast:: ExprKind :: Cast ( ptr_expr, ..) => extract_ast_path_from_expr ( & * ptr_expr) ,
18931895 ast:: ExprKind :: Type ( ptr_expr, ..) => extract_ast_path_from_expr ( & * ptr_expr) ,
@@ -1896,9 +1898,7 @@ fn extract_ast_path_from_expr(expr: &ast::Expr) -> Option<&ast::Path> {
18961898 ast:: ExprKind :: Range ( Some ( start_expr) , ..) => extract_ast_path_from_expr ( & * start_expr) ,
18971899 ast:: ExprKind :: Path ( _, path, ..) => Some ( & path) ,
18981900 ast:: ExprKind :: MacCall ( mac, ..) => Some ( & ( * mac) . path ) ,
1899- ast:: ExprKind :: Struct ( ptr_struct_expr, ..) => {
1900- Some ( & ( * ptr_struct_expr) . path )
1901- }
1901+ ast:: ExprKind :: Struct ( ptr_struct_expr, ..) => Some ( & ( * ptr_struct_expr) . path ) ,
19021902 _ => None ,
19031903 }
19041904}
@@ -1924,7 +1924,10 @@ pub(crate) fn rewrite_field(
19241924 Some ( path) => is_absolute_decl_path ( path) ,
19251925 _ => false ,
19261926 } ;
1927- let mut separator = String :: from ( struct_lit_field_separator ( context. config , force_space_after_colon) ) ;
1927+ let mut separator = String :: from ( struct_lit_field_separator (
1928+ context. config ,
1929+ force_space_after_colon,
1930+ ) ) ;
19281931 for _ in 0 ..prefix_max_width. saturating_sub ( name. len ( ) ) {
19291932 separator. push ( ' ' ) ;
19301933 }
0 commit comments