Repository navigation
Fix clippy::needless_range_loop in picker_state test (rustc 1.100.0) - #54
Conversation
Co-authored-by: Muhan Li <limuhan@msn.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Automation review — clean
Reviewed the only change in fresh_state_has_no_selection_and_top_level_expanded: replacing the indexed range loop with direct iteration over s.selected, plus assert_eq!(s.selected.len(), s.nodes.len()).
PickerState::from_tree always initializes selected as vec![false; nodes.len()], so behavior is unchanged and the length assertion actually strengthens the test (it would catch a future invariant break that the old 0..s.nodes.len() loop could miss if selected were ever shorter). No correctness, security, or regression concerns in this diff.
Sent by Cursor Automation: Review PR changes


CI's stable toolchain moved to rustc 1.100.0, whose Clippy flags
needless_range_loopin thefresh_state_has_no_selection_and_top_level_expandedtest insrc/picker_state.rs. This fails thecargo clippy --all-targets -- -D warningsstep on all three platforms (see #53).Changes:
&s.selecteddirectly instead of indexing with0..s.nodes.len().assert_eq!(s.selected.len(), s.nodes.len())so the check still covers every node (selectedis built asvec![false; n]). Behavior is unchanged.Verified locally with rustc 1.100.0 stable:
cargo clippy --all-targets -- -D warningsis clean,cargo fmt --checkpasses andcargo test --all-targetspasses. No#[allow]added.