Skip to content

style: remove useless_borrows_in_formatting from the clippy allowlist - #4220

Merged
seanmonstar merged 1 commit into
hyperium:masterfrom
ump45nose:style/remove-useless-borrows-in-formatting
Oct 2, 2026
Merged

seanmonstar merged 1 commit into
hyperium:masterfrom
ump45nose:style/remove-useless-borrows-in-formatting

Conversation

@ump45nose

Copy link
Copy Markdown
Contributor

Part of the strict clippy effort in #4071 — this takes the useless_borrows_in_formatting lint off the "lints to decide on" list.

The two remaining violations were in src/proto/h1/decode.rs, in the error paths of trailer header parsing:

format!("Invalid header name: {:?}", &header)

The & borrow was redundant for the format argument, but simply dropping it would then trip uninlined_format_args (the borrow was dodging it, since &header is not a bare identifier). Inlining the variable satisfies both lints:

format!("Invalid header name: {header:?}")
  • cargo clippy --features full reports no violations of either lint.
  • cargo test --features full --lib: 117 passed, 0 failed.

Fix the two remaining violations in src/proto/h1/decode.rs by inlining
the header variable into the format string, which also satisfies the
uninlined_format_args lint that the old &header borrow was dodging.

Refs: hyperium#4071
@seanmonstar
seanmonstar merged commit da3b1b1 into hyperium:master Oct 2, 2026
23 checks passed
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