fix: simplify required-unless predicates - #1326
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe parser changes ChangesRequiredness evaluation
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This is a localized refactor of existing CLI validation logic intended to preserve behavior while satisfying clippy; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
Summary
required_unlesspredicates for arguments and flagsnonminimal_boolValidation
cargo fmt --check -- lib/src/parse.rscargo clippy -p usage-lib --no-default-features -- -D warningsNote
Low Risk
Refactor-only change to equivalent boolean logic in CLI validation; no intended behavior change.
Overview
Rewrites how
required_unlessis computed when validating missing args and flags inparse.rs. The old form(lists non-empty) && !(unless satisfied)is replaced with a single negated OR: not(unless_any || unless_all || no unless rules defined).Behavior is unchanged—only the boolean shape changes so
clippy::nonminimal_boolpasses with-D warnings. The same logic is applied in both the argument and flag missing-value checks.Reviewed by Cursor Bugbot for commit 2c3e278. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit