Skip to content

fix(core): address Rust 1.97 Clippy warnings - #2479

Merged
goldmedal merged 1 commit into
Canner:mainfrom
ttw225:fix/rust-1-97-clippy
Jul 13, 2026
Merged

goldmedal merged 1 commit into
Canner:mainfrom
ttw225:fix/rust-1-97-clippy

Conversation

@ttw225

@ttw225 ttw225 commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rust 1.97 introduced the useless_borrows_in_formatting Clippy lint. Because CI treats warnings as errors, redundant references in formatting macros caused the Rust workflow to fail.

This PR removes those unnecessary borrows without changing runtime behavior.

Verification

  • cargo +1.97.0 clippy --all-targets --all-features -- -D warnings
  • Cargo check
  • Rust test suite

Some Wren SDK CI jobs currently fail because the required Cargo lockfile update has not reached main yet. The fix is available in #2478; these jobs should pass after it is merged and this branch is rebased onto the updated main.

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes
    • Improved formatting for schema mismatch and access-control related error messages to make diagnostics easier to read.
    • Corrected expression formatting during measure dependency resolution, improving the accuracy of generated diagnostic output.
  • Documentation / Examples
    • Updated the row-level access control example’s session-property printing for cleaner, more straightforward output.

@github-actions github-actions Bot added rust Pull requests that update rust code core labels Jul 12, 2026
@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7bbb6b5c-f17b-4d36-9ef4-ea1f6a0e608b

📥 Commits

Reviewing files that changed from the base of the PR and between 7768274 and b4b1633.

📒 Files selected for processing (6)
  • core/wren-core/core/src/logical_plan/analyze/access_control.rs
  • core/wren-core/core/src/logical_plan/analyze/plan.rs
  • core/wren-core/core/src/mdl/cube.rs
  • core/wren-core/core/src/mdl/mod.rs
  • core/wren-core/sqllogictest/src/engine/normalize.rs
  • core/wren-core/wren-example/examples/row-level-access-control.rs
🚧 Files skipped from review as they are similar to previous changes (6)
  • core/wren-core/sqllogictest/src/engine/normalize.rs
  • core/wren-core/core/src/logical_plan/analyze/plan.rs
  • core/wren-core/core/src/logical_plan/analyze/access_control.rs
  • core/wren-core/wren-example/examples/row-level-access-control.rs
  • core/wren-core/core/src/mdl/cube.rs
  • core/wren-core/core/src/mdl/mod.rs

Walkthrough

This PR removes redundant explicit borrows from Rust formatting, logging, regex replacement, catalog prefix construction, schema error reporting, and session-property debug output.

Changes

Borrow simplification

Layer / File(s) Summary
Core expression and message formatting
core/wren-core/core/src/logical_plan/analyze/..., core/wren-core/core/src/mdl/..., core/wren-core/sqllogictest/...
Formatting, logging, measure substitution, catalog prefix construction, and schema mismatch reporting now pass values directly instead of explicitly borrowing them.
Session-property debug output
core/wren-core/wren-example/examples/row-level-access-control.rs
Session properties are directly cloned and unwrapped before being printed.

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

Possibly related PRs

  • Canner/WrenAI#2265: Updates the same resolve_measures replacement formatting in core/wren-core/core/src/mdl/cube.rs.
  • Canner/WrenAI#2276: Modifies the resolve_measures dependency-substitution expression in the same file.

Suggested reviewers: douenergy, goldmedal

Poem

I’m a small rabbit, hopping through Rust,
Trimming spare borrows because trim we must.
Logs print clean, and values flow free,
Measure strings nest neatly as can be.
One little ampersand rests in the dust.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing Rust 1.97 Clippy warnings by removing redundant formatting references.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@goldmedal

Copy link
Copy Markdown
Collaborator

The shared CI failure here (maturin failed → cannot update the lock file core/wren-core-py/Cargo.lock because --locked was passed) came from the Rust core 0.2.0 bump in #2467 leaving core/wren-core-py/Cargo.lock out of sync. That's now fixed on main by #2478 — please rebase onto latest main to pick up the lockfile fix and turn CI green. 🙏

@ttw225
ttw225 force-pushed the fix/rust-1-97-clippy branch from 7768274 to b4b1633 Compare July 13, 2026 04:34

@goldmedal goldmedal 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.

Thanks @ttw225 👍

@goldmedal
goldmedal merged commit f0270c1 into Canner:main Jul 13, 2026
17 checks passed
@ttw225
ttw225 deleted the fix/rust-1-97-clippy branch July 13, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants