Skip to content

Enforce MacosNative app config validation with pattern matching#136

Merged
Miyamura80 merged 1 commit into
masterfrom
claude/fix-clippy-warnings-cQVYW
May 7, 2026
Merged

Enforce MacosNative app config validation with pattern matching#136
Miyamura80 merged 1 commit into
masterfrom
claude/fix-clippy-warnings-cQVYW

Conversation

@Miyamura80

@Miyamura80 Miyamura80 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Refactored the MacosNative app configuration validation to use exhaustive pattern matching instead of runtime checks, making invalid configurations impossible to construct.

Key Changes

  • Modified the validate_app_config function to pattern match on MacosNative { bundle_id: None, app_path: None } directly
  • Removed the conditional if bundle_id.is_none() && app_path.is_none() check
  • Now the validation error is returned unconditionally when both fields are None, as this is the only case the pattern matches

Implementation Details

This change leverages Rust's pattern matching to make the validation more explicit and type-safe. By matching on the specific case where both bundle_id and app_path are None, the code makes it clear that this is an invalid configuration state. The error is now returned directly rather than being conditional, improving code clarity and reducing the possibility of logic errors.

https://claude.ai/code/session_01JeA7bssA8UsoiQXhRBxGnV


Summary by cubic

Refactors MacosNative app config validation to match on the exact invalid state (both bundle_id and app_path are None) and return the error directly. Removes the inner conditional, keeps behavior the same (still requires at least one value), and satisfies clippy::collapsible_match.

Written for commit 23a4732. Summary will update on new commits.

Replace the inner if-let-none check with destructured `None` patterns to
satisfy clippy::collapsible_match (rust 1.95 stable). The catch-all `_`
arm continues to handle the valid configurations.
@qodo-code-review

Copy link
Copy Markdown
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more

@Miyamura80 Miyamura80 merged commit 3d62b58 into master May 7, 2026
7 checks 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