Skip to content

chore: drop redundant references in write! args - #30

Merged
OneNoted merged 2 commits into
OneNoted:mainfrom
xqqmdy:chore/clippy-1.99-useless-borrows
Nov 13, 2026
Merged

OneNoted merged 2 commits into
OneNoted:mainfrom
xqqmdy:chore/clippy-1.99-useless-borrows

Conversation

@xqqmdy

@xqqmdy xqqmdy commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

clippy 1.99 (useless_borrows_in_formatting) denies these under -D warnings; CI installs the toolchain via dtolnay/rust-toolchain@stable, so as soon as stable moves to 1.99 the lint jobs on main go red.

Stack note: This is one of four single-commit PRs reviewed bottom-up:

Until the lower PRs merge, "Files changed" also shows their commits. The stacking exists because the local pre-push hook runs full CI on the working tree: on clang >= 22 machines the vulkan feature check cannot build without PR 3, and clippy 1.99 fails without PR 1, so each branch needs the ones below it to be locally verifiable. PRs 1–2 are independently green on GitHub CI (clang 18).

Summary by CodeRabbit

  • Refactor
    • Updated internal rendering and prompt-formatting implementation details. Bar calculations, display bounds, and confirmation prompt behavior remain unchanged.

clippy 1.99 (useless_borrows_in_formatting) denies these under -D warnings;
local pre-push CI runs clippy with a newer toolchain than the one that last
touched src/ui.rs, so the hook fails on main without this.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The OSD bar code now iterates over bar heights using iterators. Confirmation prompt formatting passes prefix and suffix fields directly to formatting macros.

Changes: OSD bar iteration

Layer / File(s) Summary
Bar-height iteration
src/bin/whispers-osd.rs
BarState::update, render_meter_bars, and render_voice_bars use iterators to access bar heights. The existing calculations, bounds, and rendered positions remain unchanged.

Confirmation prompt formatting

Layer / File(s) Summary
Prompt format arguments
src/ui.rs
Confirmation prompt formatting passes prompt_prefix and prompt_suffix directly to formatting macros instead of borrowing them.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Refactor

Suggested reviewers: onenoted

Merge Risk: Minimal · up to 483ad

This change removes redundant borrows and replaces index loops with iterators without altering behavior. It is low risk and ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "chore: drop redundant references in write! args" matches the main change. The raw summary says ConfirmTheme::format_confirm_prompt in src/ui.rs now passes prompt_prefix and prompt_suffix di…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "chore: drop redundant references in write! args" matches the main change. The raw summary says ConfirmTheme::format_confirm_prompt in src/ui.rs now passes prompt_prefix and prompt_suffix directly to formatting macros instead of borrowing them, and the PR objectives say the change removes redundant references in write! arguments to address the useless_borrows_in_formatting lint. The summary also lists bar-height iteration changes in src/bin/whispers-osd.rs, which the title does not mention. That omission is acceptable because the title need not cover every detail. The title is specific and concise and does not use vague terms.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1970ec53-6253-476c-982b-1f373ee30f49
Commits

Reviewing files that changed from the base of the PR and between 5f07631 and 483ad58.

Files selected for processing: 2

  • src/bin/whispers-osd.rs
  • src/ui.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@xqqmdy xqqmdy changed the title Chore/clippy 1.99 useless borrows chore: drop redundant references in write! args Oct 30, 2026
@OneNoted
OneNoted merged commit a61187e into OneNoted:main Nov 13, 2026
3 of 4 checks passed
@xqqmdy
xqqmdy deleted the chore/clippy-1.99-useless-borrows branch November 14, 2026 17:38
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