@@ -834,7 +834,7 @@ pub(crate) fn format_impl(
834834 // there is only one where-clause predicate
835835 // recover the suppressed comma in single line where_clause formatting
836836 if generics. where_clause . predicates . len ( ) == 1 {
837- result. push_str ( "," ) ;
837+ result. push ( ',' ) ;
838838 }
839839 result. push_str ( & format ! ( "{}{{{}}}" , sep, sep) ) ;
840840 } else {
@@ -1737,18 +1737,18 @@ fn type_annotation_spacing(config: &Config) -> (&str, &str) {
17371737pub ( crate ) fn rewrite_struct_field_prefix (
17381738 context : & RewriteContext < ' _ > ,
17391739 field : & ast:: StructField ,
1740- ) -> Option < String > {
1740+ ) -> String {
17411741 let vis = format_visibility ( context, & field. vis ) ;
17421742 let type_annotation_spacing = type_annotation_spacing ( context. config ) ;
1743- Some ( match field. ident {
1743+ match field. ident {
17441744 Some ( name) => format ! (
17451745 "{}{}{}:" ,
17461746 vis,
17471747 rewrite_ident( context, name) ,
17481748 type_annotation_spacing. 0
17491749 ) ,
17501750 None => vis. to_string ( ) ,
1751- } )
1751+ }
17521752}
17531753
17541754impl Rewrite for ast:: StructField {
@@ -1768,7 +1768,7 @@ pub(crate) fn rewrite_struct_field(
17681768 }
17691769
17701770 let type_annotation_spacing = type_annotation_spacing ( context. config ) ;
1771- let prefix = rewrite_struct_field_prefix ( context, field) ? ;
1771+ let prefix = rewrite_struct_field_prefix ( context, field) ;
17721772
17731773 let attrs_str = field. attrs . rewrite ( context, shape) ?;
17741774 let attrs_extendable = field. ident . is_none ( ) && is_attributes_extendable ( & attrs_str) ;
@@ -1945,7 +1945,7 @@ fn rewrite_static(
19451945 comments_span,
19461946 true ,
19471947 )
1948- . and_then ( |res| recover_comment_removed ( res, static_parts. span , context) )
1948+ . map ( |res| recover_comment_removed ( res, static_parts. span , context) )
19491949 . or_else ( || {
19501950 let nested_indent = offset. block_indent ( context. config ) ;
19511951 let ty_span_hi = static_parts. ty . span . hi ( ) ;
@@ -2357,7 +2357,7 @@ fn rewrite_fn_base(
23572357 ret_str_len,
23582358 fn_brace_style,
23592359 multi_line_ret_str,
2360- ) ? ;
2360+ ) ;
23612361
23622362 debug ! (
23632363 "rewrite_fn_base: one_line_budget: {}, multi_line_budget: {}, param_indent: {:?}" ,
@@ -2744,7 +2744,7 @@ fn compute_budgets_for_params(
27442744 ret_str_len : usize ,
27452745 fn_brace_style : FnBraceStyle ,
27462746 force_vertical_layout : bool ,
2747- ) -> Option < ( usize , usize , Indent ) > {
2747+ ) -> ( usize , usize , Indent ) {
27482748 debug ! (
27492749 "compute_budgets_for_params {} {:?}, {}, {:?}" ,
27502750 result. len( ) ,
@@ -2781,7 +2781,7 @@ fn compute_budgets_for_params(
27812781 }
27822782 } ;
27832783
2784- return Some ( ( one_line_budget, multi_line_budget, indent) ) ;
2784+ return ( one_line_budget, multi_line_budget, indent) ;
27852785 }
27862786 }
27872787
@@ -2793,7 +2793,7 @@ fn compute_budgets_for_params(
27932793 // Account for `)` and possibly ` {`.
27942794 IndentStyle :: Visual => new_indent. width ( ) + if ret_str_len == 0 { 1 } else { 3 } ,
27952795 } ;
2796- Some ( ( 0 , context. budget ( used_space) , new_indent) )
2796+ ( 0 , context. budget ( used_space) , new_indent)
27972797}
27982798
27992799fn newline_for_brace ( config : & Config , where_clause : & ast:: WhereClause ) -> FnBraceStyle {
0 commit comments