@@ -110,21 +110,21 @@ impl Default for FixupContext {
110
110
impl FixupContext {
111
111
/// Create the initial fixup for printing an expression in statement
112
112
/// position.
113
- pub fn new_stmt ( ) -> Self {
113
+ pub ( crate ) fn new_stmt ( ) -> Self {
114
114
FixupContext { stmt : true , ..FixupContext :: default ( ) }
115
115
}
116
116
117
117
/// Create the initial fixup for printing an expression as the right-hand
118
118
/// side of a match arm.
119
- pub fn new_match_arm ( ) -> Self {
119
+ pub ( crate ) fn new_match_arm ( ) -> Self {
120
120
FixupContext { match_arm : true , ..FixupContext :: default ( ) }
121
121
}
122
122
123
123
/// Create the initial fixup for printing an expression as the "condition"
124
124
/// of an `if` or `while`. There are a few other positions which are
125
125
/// grammatically equivalent and also use this, such as the iterator
126
126
/// expression in `for` and the scrutinee in `match`.
127
- pub fn new_cond ( ) -> Self {
127
+ pub ( crate ) fn new_cond ( ) -> Self {
128
128
FixupContext { parenthesize_exterior_struct_lit : true , ..FixupContext :: default ( ) }
129
129
}
130
130
@@ -139,7 +139,7 @@ impl FixupContext {
139
139
///
140
140
/// Not every expression has a leftmost subexpression. For example neither
141
141
/// `-$a` nor `[$a]` have one.
142
- pub fn leftmost_subexpression ( self ) -> Self {
142
+ pub ( crate ) fn leftmost_subexpression ( self ) -> Self {
143
143
FixupContext {
144
144
stmt : false ,
145
145
leftmost_subexpression_in_stmt : self . stmt || self . leftmost_subexpression_in_stmt ,
@@ -158,7 +158,7 @@ impl FixupContext {
158
158
/// current expression, and is not surrounded by a paren/bracket/brace. For
159
159
/// example the `$b` in `$a + $b` and `-$b`, but not the one in `[$b]` or
160
160
/// `$a.f($b)`.
161
- pub fn subsequent_subexpression ( self ) -> Self {
161
+ pub ( crate ) fn subsequent_subexpression ( self ) -> Self {
162
162
FixupContext {
163
163
stmt : false ,
164
164
leftmost_subexpression_in_stmt : false ,
@@ -173,7 +173,7 @@ impl FixupContext {
173
173
///
174
174
/// The documentation on `FixupContext::leftmost_subexpression_in_stmt` has
175
175
/// examples.
176
- pub fn would_cause_statement_boundary ( self , expr : & Expr ) -> bool {
176
+ pub ( crate ) fn would_cause_statement_boundary ( self , expr : & Expr ) -> bool {
177
177
( self . leftmost_subexpression_in_stmt && !classify:: expr_requires_semi_to_be_stmt ( expr) )
178
178
|| ( self . leftmost_subexpression_in_match_arm && classify:: expr_is_complete ( expr) )
179
179
}
@@ -189,7 +189,7 @@ impl FixupContext {
189
189
///
190
190
/// - `true && false`, because otherwise this would be misinterpreted as a
191
191
/// "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 {
193
193
self . parenthesize_exterior_struct_lit && parser:: contains_exterior_struct_lit ( expr)
194
194
|| parser:: needs_par_as_let_scrutinee ( expr. precedence ( ) . order ( ) )
195
195
}
0 commit comments