@@ -3,7 +3,7 @@ use crate::delimiters::BreakableDelims;
33use crate :: file_comments:: FileComments ;
44use crate :: heredoc_string:: { HeredocKind , HeredocString } ;
55use crate :: line_tokens:: * ;
6- use crate :: render_queue_writer:: { MAX_LINE_LENGTH , RenderQueueWriter } ;
6+ use crate :: render_queue_writer:: RenderQueueWriter ;
77use crate :: render_targets:: {
88 BaseQueue , Breakable , BreakableCallChainEntry , BreakableEntry , ConditionalLayoutEntry ,
99} ;
@@ -173,19 +173,6 @@ impl<'src> ParserState<'src> {
173173 }
174174 }
175175
176- pub ( crate ) fn will_render_as_multiline < F > ( & mut self , f : F ) -> bool
177- where
178- F : FnOnce ( & mut ParserState < ' src > ) ,
179- {
180- let mut next_ps = ParserState :: new_with_indent_from ( self ) ;
181- // Ignore commments when determining line length
182- next_ps. with_suppress_comments ( true , f) ;
183- let data = next_ps. render_to_buffer ( ) ;
184-
185- let s = str:: from_utf8 ( & data) . expect ( "string is utf8" ) ;
186- s. trim ( ) . contains ( '\n' ) || s. len ( ) > MAX_LINE_LENGTH
187- }
188-
189176 pub ( crate ) fn has_comment_in_offset_span (
190177 & self ,
191178 start_offset : SourceOffset ,
@@ -319,15 +306,6 @@ impl<'src> ParserState<'src> {
319306 ) ) ;
320307 }
321308
322- pub ( crate ) fn with_suppress_comments < F > ( & mut self , suppress : bool , f : F )
323- where
324- F : FnOnce ( & mut ParserState < ' src > ) ,
325- {
326- self . suppress_comments_stack . push ( suppress) ;
327- f ( self ) ;
328- self . suppress_comments_stack . pop ( ) ;
329- }
330-
331309 pub ( crate ) fn new_block < F > ( & mut self , f : F )
332310 where
333311 F : FnOnce ( & mut ParserState < ' src > ) ,
@@ -791,12 +769,6 @@ impl<'src> ParserState<'src> {
791769 }
792770 }
793771
794- pub ( crate ) fn new_with_indent_from ( ps : & ParserState < ' src > ) -> Self {
795- let mut next_ps = ParserState :: new_with_reset_indentation ( ps) ;
796- next_ps. indent_depth = ps. indent_depth ;
797- next_ps
798- }
799-
800772 // Creates a copy of the parser state *with the indent_depth reset*.
801773 // This is used for heredocs, where we explicitly want to ignore current indentation.
802774 pub ( crate ) fn new_with_reset_indentation ( ps : & ParserState < ' src > ) -> Self {
0 commit comments