Skip to content

chore(clippy): resolve warnings to enable -D warnings gate - #166

Merged
Catrya merged 1 commit into
mainfrom
chore/clippy-warnings
Jul 8, 2026
Merged

chore(clippy): resolve warnings to enable -D warnings gate#166
Catrya merged 1 commit into
mainfrom
chore/clippy-warnings

Conversation

@AndreaDiazCorreia

@AndreaDiazCorreia AndreaDiazCorreia commented Jul 7, 2026

Copy link
Copy Markdown
Member

Prerequisite for #151 (CI with cargo clippy -- -D warnings).

Cleans up the 6 clippy warnings currently on main so the lint can become a required CI check without the first run rebounding.

  • Declare cfg(frb_expand) in [lints.rust] (flutter_rust_bridge macro cfg)
  • Drop useless anyhow::Error conversion in create_order
  • Fix doc lazy-continuation on ResetGuard
  • Replace argument-less format! with .to_string()
  • Mark unused process_order_event with #[allow(dead_code)]

No behavior change — all fixes are semantic no-ops.

Verified: cargo clippy -- -D warnings clean, cargo test 82 passed / 0 failed.

Summary by CodeRabbit

  • Bug Fixes

    • Improved order creation error handling so failed publishes now return a cleaner error while preserving the same rollback behavior.
    • Reduced noise from an internal warning so valid configuration flags are no longer reported as unknown during linting.
  • Chores

    • Updated subscription startup messaging and related documentation comments for clearer maintenance.

- Add `unexpected_cfgs` lint config to allow `cfg(frb_expand)` set by flutter_rust_bridge macros during codegen, preventing `cargo clippy -- -D warnings` from failing.
- Remove redundant `.into()` conversion in create_order error path.
- Fix doc comment formatting for ResetGuard (add missing blank line).
- Replace format! with direct to_string() for static string in _run_order_subscription.
- Mark process_order_event as #[allow(dead_code)] since
@coderabbitai

coderabbitai Bot commented Jul 7, 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 507bf465-49f9-4be5-8a56-36b21c0436b5

📥 Commits

Reviewing files that changed from the base of the PR and between 4d00def and 4e71d61.

📒 Files selected for processing (2)
  • rust/Cargo.toml
  • rust/src/api/orders.rs

Walkthrough

This PR adds a Cargo lints configuration to whitelist the frb_expand cfg flag for clippy, and applies small edits to orders.rs: simplified error return in create_order, an added doc comment, a logging call adjustment, and a dead-code annotation on an unused helper.

Changes

Lint Configuration and orders.rs Cleanups

Layer / File(s) Summary
Clippy unexpected_cfgs whitelist
rust/Cargo.toml
Adds a [lints.rust] block with unexpected_cfgs set to warn and a check-cfg entry for cfg(frb_expand).
Order creation error handling and minor cleanups
rust/src/api/orders.rs
Returns the caught error directly instead of via .into() in create_order's publish-failure path, adds a doc-comment line near the Kind 38383 subscription guard, switches a startup log message from format! to .to_string(), and annotates the unused process_order_event helper with #[allow(dead_code)].

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

Possibly related PRs

  • MostroP2P/app#98: Both PRs touch create_order logic in rust/src/api/orders.rs, including error return and status handling.
  • MostroP2P/app#159: Both PRs modify create_order and surrounding subscription logic in rust/src/api/orders.rs to handle failure states.

Suggested reviewers: ermeme

Poem

A cfg flag once caused a fuss,
Clippy grumbled, made a muss.
Now whitelisted, warnings cease,
Orders return errors in peace.
Hop hop hooray, small tweaks done right! 🐇✨

🚥 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 accurately summarizes the PR’s main goal: resolving Clippy warnings so the -D warnings gate can be enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/clippy-warnings

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.

@AndreaDiazCorreia
AndreaDiazCorreia requested a review from grunch July 7, 2026 22:34

@ermeme ermeme Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review Summary

Verdict: APPROVE

I reviewed the current head and found no blocking issues. The manifest change cleanly whitelists frb_expand, and the Rust edits are semantic no-ops.

Verified locally: cargo clippy -- -D warnings passes cleanly.

@Catrya Catrya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

tACK

@Catrya
Catrya merged commit 0439ab7 into main Jul 8, 2026
1 check 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