Repository navigation
style: remove redundant references in formatting macro arguments - #427
Open
david-streamlio wants to merge 1 commit into
Open
david-streamlio wants to merge 1 commit into
david-streamlio wants to merge 1 commit into
Conversation
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
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 Suggested order: this before #429, since #429 will show red until these lint errors are off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #426.
What
Removes the explicit
&from 15 formatting-macro arguments that clippy 1.98.0 flags asuseless_borrows_in_formatting. Formatting macros already take their arguments byreference, so the borrow does nothing.
Applied with
cargo clippy --fix— every hunk is a bare&removal. 15 insertions,15 deletions, no behavior change.
src/connection.rssrc/consumer/mod.rssrc/consumer/multi.rssrc/lib.rssrc/producer.rssrc/reader.rssrc/service_discovery.rsWhy now
These predate any pending change — reproduced on unmodified
master. The lint job usesunpinned
dtolnay/rust-toolchain@stable, andmasterhas not been linted since Rust1.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 0cargo clippy --tests --no-default-features --features compression,tokio-rustls-runtime,async-std-rustls-runtime,auth-oauth2,telemetry,protobuf-src -- -D warnings— exit 0cargo fmt --all --check— cleancargo test --features tokio-runtime --lib— 38 passed, 0 failedcargo test --features tokio-runtime --doc— 20 passed, 0 failedThat is every job in
.github/workflows/rust.yml.🤖 Generated with Claude Code
https://claude.ai/code/session_016225V4xL2DjNvgKMDQcu7Y