refactor: Getting rid of clippy slicing#2735
Conversation
|
PR title format: This PR is missing a conventional commit type prefix. Since it fixes clippy linting warnings without changing functionality, the type should be Suggested title: |
Code ReviewNo critical issues found. The PR cleanly replaces blanket
The zip-based rewrites correctly preserve original loop semantics — ✅ Approved |
|
PR title type suggestion: This PR should use a conventional commit type prefix. Since it's restructuring code to address clippy warnings, the type should be |
Code ReviewNo critical issues found. The changes correctly:
The zip-based rewrites correctly preserve original loop semantics — ✅ Approved Reviewed with Claude Code |
netrome
left a comment
There was a problem hiding this comment.
Nice stuff, thanks for fixing. Would be nice to use multizip to make the zip chain a bit prettier but not a hard blocker.
| .zip(their.big_e_v.iter()) | ||
| .zip(their.big_f_v.iter()) | ||
| .zip(their.big_l_v.iter()) | ||
| .zip(their.randomizer_v.iter()) | ||
| .zip(their.phi_proof0_v.iter()) | ||
| .zip(their.phi_proof1_v.iter()) | ||
| .zip( | ||
| big_e_j_zero_v.iter_mut().zip( | ||
| big_e_v | ||
| .iter_mut() | ||
| .zip(big_f_v.iter_mut()) | ||
| .zip(big_l_v.iter_mut()), |
There was a problem hiding this comment.
Not sure I've ever seen this many zips in the same expression 😂
Perhaps worth including itertools (we already have it in the workspace) and use multizip https://docs.rs/itertools/latest/itertools/fn.multizip.html
Reworks near/threshold-signatures#122
Remove the blanket
#![allow(clippy::indexing_slicing)]In some spots I added input validation and converted iterators to prevent using indexing