@@ -661,7 +661,7 @@ fn format_string_node<'src>(ps: &mut ParserState<'src>, string_node: prism::Stri
661661 // (e.g. the inner contents of a heredoc)
662662 let opener = string_node. opening_loc ( ) . map ( |s| loc_to_str ( s) . trim ( ) ) ;
663663 let closer = string_node. closing_loc ( ) . map ( |s| loc_to_str ( s) . trim ( ) ) ;
664- let is_heredoc = opener. as_ref ( ) . map ( |s| s. starts_with ( "<" ) ) . unwrap_or ( false ) ;
664+ let is_heredoc = opener. map ( |s| s. starts_with ( "<" ) ) . unwrap_or ( false ) ;
665665
666666 if is_heredoc {
667667 format_heredoc (
@@ -682,8 +682,7 @@ fn format_string_node<'src>(ps: &mut ParserState<'src>, string_node: prism::Stri
682682
683683 // If opener is nil, we must be in some kind of interpolated string context, which
684684 // means the contents must already be appropriately escaped -- hence we default to `true` here
685- let in_escaped_context =
686- is_heredoc || opener. as_ref ( ) . map ( |s| s. starts_with ( "\" " ) ) . unwrap_or ( true ) ;
685+ let in_escaped_context = is_heredoc || opener. map ( |s| s. starts_with ( "\" " ) ) . unwrap_or ( true ) ;
687686 let string_content = if in_escaped_context {
688687 loc_to_string ( string_node. content_loc ( ) )
689688 } else {
@@ -698,7 +697,7 @@ fn format_string_node<'src>(ps: &mut ParserState<'src>, string_node: prism::Stri
698697
699698 crate :: string_escape:: single_to_double_quoted (
700699 loc_to_str ( string_node. content_loc ( ) ) ,
701- opener. as_ref ( ) . unwrap ( ) ,
700+ opener. unwrap ( ) ,
702701 end_delim,
703702 )
704703 } ;
@@ -724,9 +723,8 @@ fn format_interpolated_string_node<'src>(
724723 let closer = interpolated_string_node
725724 . closing_loc ( )
726725 . map ( |s| loc_to_str ( s) . trim ( ) ) ;
727- let is_heredoc = opener. as_ref ( ) . map ( |s| s. starts_with ( "<" ) ) . unwrap_or ( false ) ;
726+ let is_heredoc = opener. map ( |s| s. starts_with ( "<" ) ) . unwrap_or ( false ) ;
728727 let needs_escape = opener
729- . as_ref ( )
730728 . map ( |s| !s. starts_with ( "\" " ) && !is_heredoc)
731729 . unwrap_or ( false ) ;
732730
@@ -796,7 +794,7 @@ fn format_interpolated_string_node<'src>(
796794 let content = loc_to_str ( string_node. content_loc ( ) ) ;
797795 let escaped = crate :: string_escape:: single_to_double_quoted (
798796 content,
799- opener. as_ref ( ) . unwrap ( ) ,
797+ opener. unwrap ( ) ,
800798 closer. unwrap_or ( "\" " ) ,
801799 ) ;
802800 ps. emit_string_content ( escaped) ;
@@ -2474,7 +2472,7 @@ fn format_symbol_node<'src>(ps: &mut ParserState<'src>, symbol_node: prism::Symb
24742472
24752473 // Check if this is a quoted symbol that needs normalization to double quotes
24762474 // Symbols like :'"foo"' (single-quoted) should become :"\"foo\""
2477- let is_single_quoted = opener. as_ref ( ) . map ( |s| * s == ":'" ) . unwrap_or ( false ) ;
2475+ let is_single_quoted = opener. map ( |s| s == ":'" ) . unwrap_or ( false ) ;
24782476
24792477 if is_single_quoted {
24802478 ps. emit_ident ( ":" ) ;
0 commit comments