Skip to content

style: remove redundant references in formatting macro arguments - #427

Open
david-streamlio wants to merge 1 commit into
streamnative:masterfrom
david-streamlio:chore/clippy-redundant-refs
Open

david-streamlio wants to merge 1 commit into
streamnative:masterfrom
david-streamlio:chore/clippy-redundant-refs

Conversation

@david-streamlio

Copy link
Copy Markdown

Fixes #426.

What

Removes the explicit & from 15 formatting-macro arguments that clippy 1.98.0 flags as
useless_borrows_in_formatting. Formatting macros already take their arguments by
reference, so the borrow does nothing.

Applied with cargo clippy --fix — every hunk is a bare & removal. 15 insertions,
15 deletions, no behavior change.

File Fixes
src/connection.rs 2
src/consumer/mod.rs 1
src/consumer/multi.rs 4
src/lib.rs 2
src/producer.rs 3
src/reader.rs 2
src/service_discovery.rs 1

Why now

These predate any pending change — reproduced on unmodified master. The lint job uses
unpinned dtolnay/rust-toolchain@stable, and master has not been linted since Rust
1.98.0 was released, so the next run on any PR will fail. See #426 for detail, including
a suggestion about pinning the CI toolchain (not addressed here).

Verification

Run locally on rustc 1.98.0, on this branch alone (master + this commit):

  • cargo clippy --tests --features telemetry,protobuf-src,admin-api -- -D warnings — exit 0
  • cargo clippy --tests --no-default-features --features compression,tokio-rustls-runtime,async-std-rustls-runtime,auth-oauth2,telemetry,protobuf-src -- -D warnings — exit 0
  • cargo fmt --all --check — clean
  • cargo test --features tokio-runtime --lib — 38 passed, 0 failed
  • cargo test --features tokio-runtime --doc — 20 passed, 0 failed

That is every job in .github/workflows/rust.yml.

🤖 Generated with Claude Code

https://claude.ai/code/session_016225V4xL2DjNvgKMDQcu7Y

clippy 1.98 flags `useless_borrows_in_formatting` at 15 sites across the crate.
Formatting macros take their arguments by reference already, so the explicit `&`
does nothing.

Applied with `cargo clippy --fix`; every hunk is a bare `&` removal, and no
behavior changes. These predate the auth-refresh work in the previous commit —
they are a newer clippy than the crate was last linted against, and both CI
clippy invocations now pass with -D warnings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016225V4xL2DjNvgKMDQcu7Y
@david-streamlio

Copy link
Copy Markdown
Author

@BewareMyPower @darinspivey @codelipenghui — could one of you take a look when you have a moment? I don't have permission to request reviewers on this repo, so flagging it here instead.

This one is mechanical (15 & removals, no behavior change) and unblocks CI: master fails both clippy jobs under Rust 1.98.0, and the lint job uses unpinned @stable, so every PR goes red once runners pick it up. Detail in #426.

Suggested order: this before #429, since #429 will show red until these lint errors are off master.

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.

CI lint job fails on Rust 1.98: 15 useless_borrows_in_formatting errors on master

1 participant