Skip to content

fix ci: clippy denies in the vacuum filter chain - #14

Merged
marcuspat merged 3 commits into
mainfrom
fix/ci-clippy
Oct 4, 2026
Merged

marcuspat merged 3 commits into
mainfrom
fix/ci-clippy

Conversation

@marcuspat

Copy link
Copy Markdown
Owner

Third CI follow-up to #11 (rustc broken locally, CI is the compiler here): clippy denies a redundant closure (|p| normalise_components(p) → pass the fn) and the now-useless .map(String::from). No semantic change.

Four formatting hunks CI caught (rustc is broken on the authoring
Mac): the traversal assert chain, the jt/jf tuple loop, the
jump-count assert, and the two golden-target asserts - exactly the
forms rustfmt wants, no semantic change.
The traversal-rejection arm used "...'...'.into()" against an
impl Into<String> parameter - the target type cannot be inferred
(E0283). Pass the &str directly; &str implements Into<String>.
redundant closure -> pass normalise_components directly; drop the
.map(String::from) the iterator no longer needs (filter_map already
yields String).
@marcuspat

Copy link
Copy Markdown
Owner Author

Gate review — reviewer: claude

Lanes: reviewed by claude

GATE USAGE reviewer=claude in=2 cached=41,795 out=909 14s model=claude-haiku-4-5-20251001,claude-opus-5[1m] $0.322 API-equiv (not billed on subscription)

Pure clippy/rustfmt cleanup. Walking the two semantic changes:

sentinel-capabilities/src/filesystem.rs:265 — failure("...", false) replacing failure("...".into(), false). The PR body (base commit 88115df) says failure takes impl Into<String>, so a &str literal coerces identically. No behavior change.

sentinel-capabilities/src/filesystem.rs:316 — the interesting one. .filter_map(|p| normalise_components(p)).filter(...).map(String::from) → .filter_map(normalise_components).filter(...). Dropping .map(String::from) is only correct if normalise_components already returns Option<String> rather than Option<&str>. Two pieces of evidence in the diff say it does: line 264 binds let Some(log_dir_norm) = normalise_components(log_dir) then let log_dir: &str = &log_dir_norm; — that reborrow is only needed if the value is owned; and line 564 calls .unwrap_or_default() on the result, which requires the inner type to be Default (&str is, via &"", so that one's weaker, but combined with the reborrow it's conclusive). So the old .map(String::from) was a String→String no-op — exactly the clippy::useless_conversion/redundant-clone class this PR is clearing. The closure-to-path change (redundant_closure) is sound because normalise_components takes a single arg by value/ref matching the iterator item; if the types didn't line up it wouldn't compile, and the collect target is unchanged.

The prefix filter semantics are untouched: starts_with(&prefix) still runs on the normalised path, so the traversal guard the comment at :262-264 describes is intact.

sentinel-exec/src/sandbox.rs — all four hunks are rustfmt rewrapping of a for loop array literal and three assert macro calls. Message strings, assertion operands, and the t(i, jt) index arithmetic are byte-identical across the rewrap. The jumps >= 5 guard (the "this test verified nothing" check) and the six assert_eq! target checks keep their original values.

No test changes needed — this diff changes no behavior, and the one place it touches test code (filesystem.rs:561-566, sandbox.rs) preserves every assertion's operands and messages.

One note, not a finding: I can't verify from the diff that cargo clippy -D warnings now passes, only that these edits target the usual lint classes. The commit message claims CI is fixed; that's unverified here.

VERDICT: APPROVED


VERDICT: APPROVED

@marcuspat
marcuspat merged commit a9d015d into main Oct 4, 2026
3 of 5 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.

1 participant