Skip to content

Commit

Permalink
Rename leftmost_subexpression_with_begin_operator
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 26, 2024
1 parent 3a8d163 commit 21ec874
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(_)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/fixup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 21ec874

Please sign in to comment.