@@ -110,21 +110,21 @@ impl Default for FixupContext {
110110impl FixupContext {
111111 /// Create the initial fixup for printing an expression in statement
112112 /// position.
113- pub fn new_stmt ( ) -> Self {
113+ pub ( crate ) fn new_stmt ( ) -> Self {
114114 FixupContext { stmt : true , ..FixupContext :: default ( ) }
115115 }
116116
117117 /// Create the initial fixup for printing an expression as the right-hand
118118 /// side of a match arm.
119- pub fn new_match_arm ( ) -> Self {
119+ pub ( crate ) fn new_match_arm ( ) -> Self {
120120 FixupContext { match_arm : true , ..FixupContext :: default ( ) }
121121 }
122122
123123 /// Create the initial fixup for printing an expression as the "condition"
124124 /// of an `if` or `while`. There are a few other positions which are
125125 /// grammatically equivalent and also use this, such as the iterator
126126 /// expression in `for` and the scrutinee in `match`.
127- pub fn new_cond ( ) -> Self {
127+ pub ( crate ) fn new_cond ( ) -> Self {
128128 FixupContext { parenthesize_exterior_struct_lit : true , ..FixupContext :: default ( ) }
129129 }
130130
@@ -139,7 +139,7 @@ impl FixupContext {
139139 ///
140140 /// Not every expression has a leftmost subexpression. For example neither
141141 /// `-$a` nor `[$a]` have one.
142- pub fn leftmost_subexpression ( self ) -> Self {
142+ pub ( crate ) fn leftmost_subexpression ( self ) -> Self {
143143 FixupContext {
144144 stmt : false ,
145145 leftmost_subexpression_in_stmt : self . stmt || self . leftmost_subexpression_in_stmt ,
@@ -158,7 +158,7 @@ impl FixupContext {
158158 /// current expression, and is not surrounded by a paren/bracket/brace. For
159159 /// example the `$b` in `$a + $b` and `-$b`, but not the one in `[$b]` or
160160 /// `$a.f($b)`.
161- pub fn subsequent_subexpression ( self ) -> Self {
161+ pub ( crate ) fn subsequent_subexpression ( self ) -> Self {
162162 FixupContext {
163163 stmt : false ,
164164 leftmost_subexpression_in_stmt : false ,
@@ -173,7 +173,7 @@ impl FixupContext {
173173 ///
174174 /// The documentation on `FixupContext::leftmost_subexpression_in_stmt` has
175175 /// examples.
176- pub fn would_cause_statement_boundary ( self , expr : & Expr ) -> bool {
176+ pub ( crate ) fn would_cause_statement_boundary ( self , expr : & Expr ) -> bool {
177177 ( self . leftmost_subexpression_in_stmt && !classify:: expr_requires_semi_to_be_stmt ( expr) )
178178 || ( self . leftmost_subexpression_in_match_arm && classify:: expr_is_complete ( expr) )
179179 }
@@ -189,7 +189,7 @@ impl FixupContext {
189189 ///
190190 /// - `true && false`, because otherwise this would be misinterpreted as a
191191 /// "let chain".
192- pub fn needs_par_as_let_scrutinee ( self , expr : & Expr ) -> bool {
192+ pub ( crate ) fn needs_par_as_let_scrutinee ( self , expr : & Expr ) -> bool {
193193 self . parenthesize_exterior_struct_lit && parser:: contains_exterior_struct_lit ( expr)
194194 || parser:: needs_par_as_let_scrutinee ( expr. precedence ( ) . order ( ) )
195195 }
0 commit comments