Skip to content

fix: remove redundant references in format macro arguments to satisfy clippy#4872

Closed
andygrove wants to merge 2 commits into
apache:mainfrom
andygrove:fix/fs-hdfs-clippy-redundant-ref
Closed

fix: remove redundant references in format macro arguments to satisfy clippy#4872
andygrove wants to merge 2 commits into
apache:mainfrom
andygrove:fix/fs-hdfs-clippy-redundant-ref

Conversation

@andygrove

@andygrove andygrove commented Jul 9, 2026

Copy link
Copy Markdown
Member

Which issue does this PR close?

N/A. This is a small lint fix to unblock CI.

Rationale for this change

A newer Rust/clippy version now flags the useless_borrows_in_formatting lint (redundant reference in ... argument) in two workspace crates. CI runs cargo clippy --all-targets --workspace -- -D warnings, and clippy aborts each crate at its first denied lint, so the two occurrences surface one at a time: fixing only the first lets clippy proceed to the next crate and fail there.

error: redundant reference in `info!` argument
   --> fs-hdfs/src/hdfs.rs:103:54

error: redundant reference in `write!` argument
   --> spark-expr/src/conversion_funcs/cast.rs:735:69

The fs-hdfs crate is a workspace member listed in members but not default-members, so local default-member builds do not lint it, which is why this only shows up in CI.

What changes are included in this PR?

Remove the redundant & in two format macro arguments:

  • native/fs-hdfs/src/hdfs.rs:103: the namenode_uri argument in the info! call.
  • native/spark-expr/src/conversion_funcs/cast.rs:735: the eval_mode argument in the Cast Display write! call.

How are these changes tested?

cargo clippy --all-targets --workspace -- -D warnings passes end-to-end with these changes and fails without them. Covered by the existing rust-test CI job.

andygrove added 2 commits July 9, 2026 08:27
The same clippy `useless_borrows_in_formatting` lint that fs-hdfs
tripped also fires on the `eval_mode` argument in `Cast`'s `Display`
impl. Clippy reports it only after the fs-hdfs fix lets it proceed to
`spark-expr`, so both must be fixed together to get `rust-test` green.
@andygrove andygrove changed the title fix: remove redundant reference in fs-hdfs info! argument to satisfy clippy fix: remove redundant references in format macro arguments to satisfy clippy Jul 9, 2026
@mbutrovich

Copy link
Copy Markdown
Contributor

#4840 has the fixes already and should get through CI first.

@andygrove andygrove closed this Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants