Skip to content

refactor(tests): resolve clippy warnings for needless range loop and vec initialization - #420

Open
aoright wants to merge 1 commit into
firecrawl:mainfrom
aoright:fix/test-clippy-needless-range-and-vec
Open

refactor(tests): resolve clippy warnings for needless range loop and vec initialization#420
aoright wants to merge 1 commit into
firecrawl:mainfrom
aoright:fix/test-clippy-needless-range-and-vec

Conversation

@aoright

@aoright aoright commented Aug 18, 2026

Copy link
Copy Markdown

Summary

  • Replace for r in 0..9 with idiomatic for (r, name) in names.iter().enumerate() in src/tables/detect_rects.rs (clippy::needless_range_loop).
  • Simplify Vec::new() followed by consecutive pushes into vec![...] in src/tables/mod.rs (clippy::vec_init_then_push).

Summary by cubic

Refactors test fixtures to resolve clippy::needless_range_loop and clippy::vec_init_then_push without changing expected outcomes. The rectangle test now iterates names.iter().enumerate() instead of 0..9, so the row count follows names.len() rather than a hardcoded constant.

Review notes

  • src/tables/detect_rects.rs: Replace range loop with (r, name) from names.iter().enumerate(); use name directly instead of indexing; other logic unchanged.
  • src/tables/mod.rs: Replace Vec::new() followed by four pushes with a single vec![...] header initialization.

Written for commit 55aac3b. Summary will update on new commits.

Review in cubic

…vec initialization

Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Shadow auto-approve: would auto-approve. Test-only refactor that resolves clippy warnings by switching to enumerate/vec! macros, preserving identical behavior as verified in the diffs.

Re-trigger cubic

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