refactor(slice-safety): deny(clippy::indexing_slicing) + scoped escapes (#341)#378
Merged
Conversation
…coped escapes (#341) - Lift `#[deny(clippy::indexing_slicing)]` crate-wide in `src/lib.rs`. Tests stay permissive via `#![cfg_attr(test, allow(..))]` — unit / integration tests routinely index into just-pushed buffers and are not expected to migrate. - Migrate the highest-risk unchecked indexing in production code to `.get(..).ok_or_else(..)` returning typed errors: `OptionChain` file-name parsing and CSV row reads in `src/chains/chain.rs`, and the binomial-root lookup in `Option::binomial_price` in `src/model/option.rs`. - Remaining call sites carry a scoped `#![allow(clippy::indexing_slicing)]` at the top of each affected module with a one-paragraph migration note. They are tracked as per-module follow-ups to #341 so that the deny-level lint can be rolled out without a massive, risky single PR. Closes #341 (slice-safety floor; per-module migration continues).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #341 (slice-safety floor; per-module migration continues).
Test plan