Skip to content

chore: satisfy Rust 1.97 useless_borrows_in_formatting lint - #1127

Merged
mergify[bot] merged 1 commit into
sigp:unstablefrom
shane-moore:chore/clippy-rust-1-97
Jul 10, 2026
Merged

chore: satisfy Rust 1.97 useless_borrows_in_formatting lint#1127
mergify[bot] merged 1 commit into
sigp:unstablefrom
shane-moore:chore/clippy-rust-1-97

Conversation

@shane-moore

Copy link
Copy Markdown
Member

Problem, Evidence, and Context

  • CI's check-code job runs make lint against the latest stable Rust, which is now 1.97 (released 2026-07-07). Rust 1.97 tightened clippy::useless_borrows_in_formatting, which now fires on two pre-existing redundant references passed to write!/format! macros.
  • Because the offending lines live on unstable, check-code is currently red on every open PR (e.g. feat: instruments proposer QBFT lifecycle #1105), not any single feature branch.
  • Evidence: cargo clippy --workspace --tests under 1.97 fails with redundant reference in write!/format! argument at logging/src/format.rs:204 and eth/src/sync.rs:166.

Change Overview

  • Drop the redundant & in two format-macro arguments:
    • logging/src/format.rs span-fields formatter
    • eth/src/sync.rs WS-bind error message
  • No behavior change; purely satisfies the stricter lint. Nothing else was touched (Cargo.lock unchanged).

Risks, Trade-offs, and Mitigations

  • None of note. Display output is identical whether the value is borrowed or not; the & was always redundant.

Validation

  • make lint (clippy under Rust 1.97) passes clean across the full workspace after the change.
  • cargo fmt --check passes.

Rollback

  • Revert the commit; no config, data, or runtime impact.

Rust 1.97 tightened clippy::useless_borrows_in_formatting, which now
fires on two pre-existing redundant references passed to write!/format!
macros. Drop the redundant `&` in the logging span formatter and the eth
sync WS-bind error so `check-code` passes across all open PRs.
@shane-moore
shane-moore force-pushed the chore/clippy-rust-1-97 branch from 4f5c72a to 84d9950 Compare July 10, 2026 01:37
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.63%. Comparing base (7266189) to head (84d9950).

Files with missing lines Patch % Lines
anchor/eth/src/sync.rs 0.00% 1 Missing ⚠️
anchor/logging/src/format.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #1127   +/-   ##
=========================================
  Coverage     62.62%   62.63%           
=========================================
  Files           161      161           
  Lines         26925    26922    -3     
=========================================
  Hits          16862    16862           
+ Misses        10063    10060    -3     
Flag Coverage Δ
rust 62.63% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mergify

mergify Bot commented Jul 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mergify
mergify Bot merged commit 3a41443 into sigp:unstable Jul 10, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants