From 21ec874bd5ddeaf64aeb50df44ede6542eefbafa Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 26 Dec 2024 13:52:12 -0800 Subject: [PATCH] Rename leftmost_subexpression_with_begin_operator --- src/expr.rs | 8 ++++---- src/fixup.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/expr.rs b/src/expr.rs index d974a5518..a2e47d31b 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -3328,7 +3328,7 @@ pub(crate) mod printing { fn print_expr_binary(e: &ExprBinary, tokens: &mut TokenStream, fixup: FixupContext) { outer_attrs_to_tokens(&e.attrs, tokens); - let left_fixup = fixup.leftmost_subexpression_with_begin_operator( + let left_fixup = fixup.leftmost_subexpression_with_operator( #[cfg(feature = "full")] match &e.op { BinOp::Sub(_) @@ -3414,7 +3414,7 @@ pub(crate) mod printing { fn print_expr_call(e: &ExprCall, tokens: &mut TokenStream, fixup: FixupContext) { outer_attrs_to_tokens(&e.attrs, tokens); - let func_fixup = fixup.leftmost_subexpression_with_begin_operator( + let func_fixup = fixup.leftmost_subexpression_with_operator( #[cfg(feature = "full")] true, false, @@ -3591,7 +3591,7 @@ pub(crate) mod printing { fn print_expr_index(e: &ExprIndex, tokens: &mut TokenStream, fixup: FixupContext) { outer_attrs_to_tokens(&e.attrs, tokens); - let obj_fixup = fixup.leftmost_subexpression_with_begin_operator( + let obj_fixup = fixup.leftmost_subexpression_with_operator( #[cfg(feature = "full")] true, false, @@ -3752,7 +3752,7 @@ pub(crate) mod printing { fn print_expr_range(e: &ExprRange, tokens: &mut TokenStream, fixup: FixupContext) { outer_attrs_to_tokens(&e.attrs, tokens); if let Some(start) = &e.start { - let start_fixup = fixup.leftmost_subexpression_with_begin_operator(true, false); + let start_fixup = fixup.leftmost_subexpression_with_operator(true, false); print_subexpression( start, start_fixup.precedence(start) <= Precedence::Range, diff --git a/src/fixup.rs b/src/fixup.rs index d0f6982b3..03e13b09b 100644 --- a/src/fixup.rs +++ b/src/fixup.rs @@ -230,7 +230,7 @@ impl FixupContext { /// Transform this fixup into the one that should apply when printing a /// leftmost subexpression followed by punctuation that is legal as the /// first token of an expression. - pub fn leftmost_subexpression_with_begin_operator( + pub fn leftmost_subexpression_with_operator( self, #[cfg(feature = "full")] next_operator_can_begin_expr: bool, next_operator_can_begin_generics: bool,