Skip to content

4534: fix Rust 1.95 Clippy in camera-profile lookup - #4535

Closed
lostwald wants to merge 1 commit into
storytold:mainfrom
lostwald:fix/camera-profile-nonminimal-bool
Closed

lostwald wants to merge 1 commit into
storytold:mainfrom
lostwald:fix/camera-profile-nonminimal-bool

Conversation

@lostwald

@lostwald lostwald commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #4534.

Replace the negated is_some_and file-extension check with its equivalent is_none_or predicate. Preserve the regular-file guard, short-circuit behavior, candidate ranking and profile matching. No lint suppression, dependency, CI, asset or face-ignore changes.

This is a separate baseline repair blocking full validation of #3757.

Validation

  • Before: on clean main 5a24289898fd26abd1c4c127d98ba587b15f169d, cargo clippy -p lightcraft-engine --lib -- -D warnings fails at camera_profiles.rs:215 with denied clippy::nonminimal_bool (Rust/Clippy 1.95.0).
  • After: cargo xtask ci passed all nine steps: fmt, workspace Clippy with warnings denied, HEIF, tests, parity, layers, assets, roots and WASM.
  • macOS aarch64, Apple M2 Metal adapter. The gate recorded 159 capability/data skips: 148 corpus, 8 model, 2 fonts and 1 GPU. Missing-corpus/model checks were not exercised.
  • Existing profile-lookup regressions run in the full suite. This is a logically equivalent lint-only change, so the regression witness is the failing-before/passing-after Clippy gate rather than a new behavior assertion.

The diff was reviewed and is exactly one changed source line.

Summary by CodeRabbit

  • Bug Fixes
    • Local camera-profile scanning now skips files without a .json extension, as well as files with other extensions and non-regular files.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The local camera-profile scan now uses is_none_or to skip paths without a .json extension or with a different extension. The regular-file check remains in place.

Changes: Camera profile filtering

Layer / File(s) Summary
JSON extension filter
crates/engine/src/camera_profiles.rs
The extension check now uses is_none_or to skip paths without a .json extension or with a different extension. The regular-file check remains in place.

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

Change: Refactor · Severity of issue fixed: Medium

Suggested reviewers: eliets2, endthestart

Merge Risk: Minimal · up to 58e8b

This is a lint-only repair that keeps camera-profile scanning behavior unchanged. It carries no meaningful merge risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the Clippy 1.95 lint fix in the camera-profile lookup, which matches the single-line change from is_some_and to is_none_or in camera_profiles.rs. It identifies the issue number and the…
Linked Issues check Passed Directly linked issue #4534 requires replacing the negated is_some_and extension check at crates/engine/src/camera_profiles.rs:215 with path.extension().is_none_or(|x| x != "json"), keeping the …
Out of Scope Changes check Passed The PR summary and PR description both report one changed line (+1/-1) in crates/engine/src/camera_profiles.rs. The reviewed head line at the changed location matches the required replacement in #45…
Full details: Title check

Explanation

The title names the Clippy 1.95 lint fix in the camera-profile lookup, which matches the single-line change from is_some_and to is_none_or in camera_profiles.rs. It identifies the issue number and the affected area. It does not describe the specific predicate change, but it reflects the main purpose of the PR.

Full details: Linked Issues check

Explanation

Directly linked issue #4534 requires replacing the negated is_some_and extension check at crates/engine/src/camera_profiles.rs:215 with path.extension().is_none_or(|x| x != "json"), keeping the regular-file guard, short-circuit evaluation, ranking and existing tests. The reviewed head contains if path.extension().is_none_or(|x| x != "json") || !path.is_file() { in get_from. The base line quoted in #4534 is if !path.extension().is_some_and(|x| x == "json") || !path.is_file() {. The two are logically equivalent: the negation of is_some_and(x == json) is is_none_or(x != json). The !path.is_file() guard and the evaluation order (extension check first) are unchanged. The ranking and load logic in the same function are unchanged in the head text. No lint suppression or CI change is present in the head file. The whole-PR diff tool was unavailable, so the base blob was confirmed only from the issue text. The author's reported cargo xtask ci pass is not independently verified here. No new test is required by #4534.

Full details: Out of Scope Changes check

Explanation

The PR summary and PR description both report one changed line (+1/-1) in crates/engine/src/camera_profiles.rs. The reviewed head line at the changed location matches the required replacement in #4534. The PR makes no lint suppression, dependency, CI, asset, or face-ignore change, as the description states. The change therefore connects directly to #4534. Limitation: the whole-PR text diff could not be read because changed blobs were missing from the checkout, so the file list rests on the summary and PR description rather than a direct diff read.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5a24289 and 58e8bbc.

Files selected for processing: 1

  • crates/engine/src/camera_profiles.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@trufae

trufae commented Nov 20, 2026

Copy link
Copy Markdown

@FredApps Could you review this small baseline repair for merge? Its CI, Windows and Sonar checks are green, and current main still contains the Clippy 1.95 predicate it fixes. It is the remaining baseline prerequisite for #3964 and #4544. Both branches temporarily carry the same one-line change with its original authorship; I will remove those copies once this lands. No broader camera-profile change is requested.

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

Reviewed the one-line predicate against current main: None, non-JSON extensions and non-regular paths retain the same behavior and short-circuit order. The documented FIFO/directory guard, ranking and loading logic are unchanged. No findings.

The identical camera_profiles.rs and original-authorship repair were exercised in the refreshed #3964 validation: all 11 camera-profile tests and all nine local gates passed (1,505 seconds; 179 capability/data skips disclosed). This is evidence for the same rebased repair, not a separate build of this PR head. The existing PR CI checks are also green.

@lostwald

Copy link
Copy Markdown
Contributor Author

Could a maintainer merge this when convenient? The one-line repair at 58e8bbc7c is approved by trufae; Linux CI, SonarCloud and CodeRabbit have passed, and the full nine-step local gate passed with capability/data skips disclosed above. It removes the clean-main Rust 1.95 Clippy blocker holding up final integration of #3757. No further code changes or extra review run are requested.

@trufae

trufae commented Nov 26, 2026

Copy link
Copy Markdown

Cc @FredApps

@lostwald

Copy link
Copy Markdown
Contributor Author

Closing as superseded: main now contains the identical path.extension().is_none_or(|x| x != "json") predicate from commit 20c0943d7eb733b90916c7555bb0457f0768395f, carried by merged #2675. I verified the current main source. This PR would no longer add a repair, so it should not reset reviews or duplicate the landed fix. The branch is retained; #3757 will use the existing main fix and no longer needs this dependency.

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.

Rust 1.95 Clippy rejects the camera-profile JSON file filter

2 participants