Skip to content

Fix clippy 1.97 useless_borrows_in_formatting on main - #158

Merged
spacebear21 merged 1 commit into
Uniffi-Dart:mainfrom
chavic:fix-clippy-197-format-borrows
Aug 21, 2026
Merged

Fix clippy 1.97 useless_borrows_in_formatting on main#158
spacebear21 merged 1 commit into
Uniffi-Dart:mainfrom
chavic:fix-clippy-197-format-borrows

Conversation

@chavic

@chavic chavic commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What

Removes five redundant & borrows in format!/println! arguments, in four files. Display for &T forwards to Display for T, so the output is byte-identical.

Why

Clippy 1.97 extended useless_borrows_in_formatting to cover these, and the CI runners now ship stable 1.97.1. main last ran CI in June, so it still shows green — but any fresh Lints (stable) run fails on these lines. The run on #156 shows this: it flags enums.rs:39, render/mod.rs:60, and stream/mod.rs:11, none of which that PR touches.

Verified locally: cargo +stable clippy -- -D warnings (clippy 1.98.0) reports five redundant reference errors on main, and none with this change.

Context

The same change is currently riding along in #149, #152, and #157, and was reverted from #150 after a review discussion in which the failure could not be reproduced (the reproduction attempt used an outdated toolchain — that was my error, corrected on the threads). Landing it once here lets all four branches rebase or drop their copies, and un-reds main for every future PR.

🤖 Generated with Claude Code

Clippy 1.97 extended useless_borrows_in_formatting to flag these five
borrows, and CI runners now ship stable 1.97.1, so the Lints (stable)
job fails on main (see the run on Uniffi-Dart#156, which flags these exact lines
without touching them). Verified: clippy 1.98.0 reports five
'redundant reference' errors on main and none with this change.

Display for &T forwards to Display for T, so output is byte-identical.

The same change rode along in Uniffi-Dart#149, Uniffi-Dart#152, Uniffi-Dart#157 (and was reverted from
Uniffi-Dart#150 when it could not be reproduced locally on an outdated toolchain).
Landing it once on main lets those branches rebase clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HDnKiUL8NDSpeaPvyKJeoR
@chavic
chavic requested a review from spacebear21 August 21, 2026 15:08

@spacebear21 spacebear21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@spacebear21
spacebear21 merged commit 3df96c8 into Uniffi-Dart:main Aug 21, 2026
25 of 30 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