@@ -2519,7 +2519,7 @@ fn format_binary_inner(ps: &mut dyn ConcreteParserState, binary: Binary) {
25192519 } ) ) ;
25202520 }
25212521
2522- let comparison_operators = vec ! [ ">" , ">=" , "===" , "==" , "<" , "<=" , "<=>" , "!=" ] ;
2522+ let comparison_operators = [ ">" , ">=" , "===" , "==" , "<" , "<=" , "<=>" , "!=" ] ;
25232523 let is_not_comparison = !comparison_operators. iter ( ) . any ( |o| o == & op. 0 ) ;
25242524
25252525 let next_expr = * binary. 3 ;
@@ -2695,7 +2695,7 @@ fn can_elide_parens_for_reserved_names(cc: &[CallChainElement]) -> bool {
26952695 . iter ( )
26962696 . any ( |e| matches ! ( e, CallChainElement :: DotTypeOrOp ( ..) ) ) ;
26972697 let is_bare_reserved_method_name = is_bare_call
2698- && match cc. get ( 0 ) {
2698+ && match cc. first ( ) {
26992699 Some ( CallChainElement :: IdentOrOpOrKeywordOrConst (
27002700 IdentOrOpOrKeywordOrConst :: Ident ( Ident ( _, ident, _) ) ,
27012701 ) ) => {
@@ -2709,7 +2709,7 @@ fn can_elide_parens_for_reserved_names(cc: &[CallChainElement]) -> bool {
27092709 return true ;
27102710 }
27112711
2712- let is_rspec_describe = match ( cc. get ( 0 ) , cc. get ( 2 ) ) {
2712+ let is_rspec_describe = match ( cc. first ( ) , cc. get ( 2 ) ) {
27132713 (
27142714 Some ( CallChainElement :: VarRef ( VarRef ( _, VarRefType :: Const ( Const ( _, c, _) ) ) ) ) ,
27152715 Some ( CallChainElement :: IdentOrOpOrKeywordOrConst ( IdentOrOpOrKeywordOrConst :: Ident (
@@ -2903,7 +2903,7 @@ pub fn format_method_add_block(ps: &mut dyn ConcreteParserState, mab: MethodAddB
29032903 }
29042904}
29052905
2906- pub fn is_empty_bodystmt ( bodystmt : & Vec < Expression > ) -> bool {
2906+ pub fn is_empty_bodystmt ( bodystmt : & [ Expression ] ) -> bool {
29072907 bodystmt. len ( ) == 1 && matches ! ( bodystmt[ 0 ] , Expression :: VoidStmt ( ..) )
29082908}
29092909
@@ -3024,7 +3024,7 @@ fn get_brace_block_render_method(
30243024 ps : & mut dyn ConcreteParserState ,
30253025 start_line : u64 ,
30263026 end_line : u64 ,
3027- body : & Vec < Expression > ,
3027+ body : & [ Expression ] ,
30283028) -> BraceBlockRenderMethod {
30293029 let has_multiple_expressions = body. len ( ) > 1 ;
30303030 if has_multiple_expressions {
@@ -3132,12 +3132,12 @@ pub fn format_keyword(
31323132
31333133pub fn format_while (
31343134 ps : & mut dyn ConcreteParserState ,
3135- conditional : Box < Expression > ,
3135+ conditional : Expression ,
31363136 exprs : Vec < Expression > ,
31373137 kw : String ,
31383138 start_end : StartEnd ,
31393139) {
3140- format_conditional ( ps, * conditional, exprs, kw, None , Some ( start_end) ) ;
3140+ format_conditional ( ps, conditional, exprs, kw, None , Some ( start_end) ) ;
31413141
31423142 ps. with_start_of_line (
31433143 true ,
@@ -3751,8 +3751,8 @@ pub fn format_expression(ps: &mut dyn ConcreteParserState, expression: Expressio
37513751 Expression :: Yield ( y) => format_yield ( ps, y) ,
37523752 Expression :: Break ( b) => format_keyword ( ps, b. 1 , "break" . to_string ( ) , b. 2 ) ,
37533753 Expression :: MethodAddBlock ( mab) => format_method_add_block ( ps, mab) ,
3754- Expression :: While ( w) => format_while ( ps, w. 1 , w. 2 , "while" . to_string ( ) , w. 3 ) ,
3755- Expression :: Until ( u) => format_while ( ps, u. 1 , u. 2 , "until" . to_string ( ) , u. 3 ) ,
3754+ Expression :: While ( w) => format_while ( ps, * w. 1 , w. 2 , "while" . to_string ( ) , w. 3 ) ,
3755+ Expression :: Until ( u) => format_while ( ps, * u. 1 , u. 2 , "until" . to_string ( ) , u. 3 ) ,
37563756 Expression :: WhileMod ( wm) => format_inline_mod ( ps, wm. 1 , wm. 2 , "while" . to_string ( ) ) ,
37573757 Expression :: UntilMod ( um) => format_inline_mod ( ps, um. 1 , um. 2 , "until" . to_string ( ) ) ,
37583758 Expression :: IfMod ( wm) => format_multilinable_mod ( ps, wm. 1 , wm. 2 , "if" . to_string ( ) ) ,
0 commit comments