Fix Clippy Errors #42
Closed
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.
Replaced loops that indexed collections with iterator-based patterns (iter_mut() + enumerate() or direct slice fills) to mutate elements without manual indexing.
Flattened nested if let/if chains into single guard-style if let statements, keeping control flow intact while reducing nesting.
Removed superfluous references so functions receive owned or already-borrowed values directly.
Avoided computing a remainder by 1. Instead, added explicit branches (e.g., return a constant true vector when density is 1).
Renamed methods from into_* to to_* when they take &self, aligning with naming conventions.
Dropped unused generic parameters and updated all call sites to match the leaner signatures.
Used struct update syntax (Struct { field, ..Default::default() }) to set fields during construction rather than mutating after a Default init.
Switched function parameters from &Vec<> to the more general &[], avoiding unnecessary allocations.
Replaced as f64 casts with f64::from(...) to prevent potential silent loss and satisfy lint expectations.
Called typed ::default() constructors (e.g., BTreeMap::default()) instead of Default::default() for clarity.