Skip to content

fix(lint): replace 3 direct indexing sites with .get() + None handling#208

Merged
forkwright merged 1 commit intomainfrom
fix/lint-indexing-slicing
Apr 20, 2026
Merged

fix(lint): replace 3 direct indexing sites with .get() + None handling#208
forkwright merged 1 commit intomainfrom
fix/lint-indexing-slicing

Conversation

@forkwright
Copy link
Copy Markdown
Owner

Replaces 3 RUST/indexing-slicing direct indexing calls with .first()/.get() + unwrap_or_else(|| unreachable!(...)) to document the safety invariant explicitly rather than relying on silent panics.

Sites fixed:

  • ergasia/src/extract/pipeline.rs:46 — archives is non-empty (checked via is_empty() guard)
  • ergasia/src/session.rs:50listen_port_range is [u16; 2], so indices 0 and 1 are always valid
  • syndesis/src/clock/estimator.rs:204 — samples has exactly 1 element (checked via len() == 1 guard)

All affected crate tests pass. Gate fails only on the ~74 pre-existing warnings in other crates (aitesis/komide/zetesis/paroche) handled by parallel agents.

Part of the harmonia 77-warning cleanup arc unblocking 05e cutover.

Clears RUST/indexing-slicing in:
- ergasia/src/extract/pipeline.rs:46
- ergasia/src/session.rs:50
- syndesis/src/clock/estimator.rs:204

For each site: all three indices are provably in-bounds, so replaced with
.first()/.get() + unwrap_or_else(|| unreachable!("...")) documenting the
invariant instead of relying on a silent panic.

Part of the harmonia 77-warning cleanup arc unblocking 05e cutover.
@forkwright forkwright merged commit 077f542 into main Apr 20, 2026
2 of 3 checks passed
@forkwright forkwright deleted the fix/lint-indexing-slicing branch April 20, 2026 12:57
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