Skip to content

fix(ci): drop redundant reference in format! arg (clippy 0.1.97 gate) - #93

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/ci-clippy-redundant-format-ref
Jul 9, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
fix/ci-clippy-redundant-format-ref

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

What

CI's rolling stable toolchain bumped to rustc/clippy 1.97.0 (2026-07-07), which added the "redundant reference in format! argument" lint. That trips the existing cargo clippy --all-targets -- -D warnings gate on a pre-existing line in crates/mlx-core/src/tools/mod.rs:

error: Some(format!("Tool call missing name: {}", &raw_content)),   // &raw_content is now flagged

This is what turned the Rust Lint → Clippy job red on main (first failure on #89, then the #90 merge — run 29022183758). The code itself dates back to #64; nothing on #90 touched it — a toolchain bump surfaced it.

Fix

Inline the captured identifier:

error: Some(format!("Tool call missing name: {raw_content}")),

raw_content is still moved into the struct field on the next line, so behavior is unchanged.

Verification

Reproduced the CI toolchain locally (rustup update stable → clippy 0.1.97 (2d8144b788 2026-07-07)) and ran the exact gate:

cargo clippy -p mlx-core --all-targets -- -D warnings
    Finished `dev` profile in 2m 34s   # exit 0, no redundant-reference error

Only remaining output is the pre-existing block v0.1.6 future-incompat note (present on all green runs; not a -D warnings failure).

🤖 Generated with Claude Code


Note

Low Risk
One-line formatting change in an error message path; no logic or API changes.

Overview
Unblocks Rust Lint → Clippy on CI after clippy 0.1.97 started enforcing the redundant-reference-in-format! lint under -D warnings.

In ToolCallResult::missing_name, the error string now uses inline capture ({raw_content}) instead of {}", &raw_content. The message and move semantics are unchanged.

Reviewed by Cursor Bugbot for commit 44cc4cd. Bugbot is set up for automated code reviews on this repo. Configure here.

CI rolling `stable` bumped to rustc/clippy 1.97.0 (2026-07-07), whose
"redundant reference in `format!` argument" lint fails the `cargo clippy
--all-targets -- -D warnings` gate on the pre-existing
`format!("Tool call missing name: {}", &raw_content)` in tools/mod.rs.
Inline the captured identifier (`{raw_content}`) — `raw_content` is still
moved into the struct field on the next line, so behavior is unchanged.

Verified green under the exact CI toolchain (clippy 0.1.97): local
`cargo clippy -p mlx-core --all-targets -- -D warnings` finishes clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@cursor

cursor Bot commented Jul 9, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_2865ca3f-889f-423a-8b93-38e04caba000)

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 799f0b4e-bd70-463d-9acc-111b060cc15b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-clippy-redundant-format-ref

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

Comment @coderabbitai help to get the list of available commands.

@Brooooooklyn
Brooooooklyn merged commit 6417815 into main Jul 9, 2026
7 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/ci-clippy-redundant-format-ref branch July 9, 2026 15:56
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.

1 participant