#243·memvid

[BUG] Redundant closures in xlsx_chunker and xlsx_table_detect fail clippy::pedantic

Author: rohitdevsolCreated Jul 24, 2026Updated Jul 26, 2026
Labelsbug

Bug Description

Redundant closures in xlsx_chunker and xlsx_table_detect fail clippy::pedantic

Steps to Reproduce

  1. Clone the repo and run: cargo clippy --workspace --all-targets -- -D warnings

Expected Behavior

Zero clippy warnings/errors, as per the project's zero-warning policy documented in CONTRIBUTING.md

Actual Behavior

Two clippy::redundant_closure_for_method_calls errors

rust
error: redundant closure
   --> src/reader/xlsx_chunker.rs:330:40
    |
330 |         let num_cols = data.iter().map(|r| r.len()).max().unwrap_or(0) as u32;
    |                                        ^^^^^^^^^^^ help: replace the closure with the method itself: `std::vec::Vec::len`

error: redundant closure
   --> src/reader/xlsx_table_detect.rs:533:40
    |
533 |         let num_cols = data.iter().map(|r| r.len()).max().unwrap_or(0) as u32;
    |                                        ^^^^^^^^^^^ help: replace the closure with the method itself: `std::vec::Vec::len`

Both are identical patterns inside #[cfg(test)] make_grid helper functions.

Environment

  • OS: macOS 25.5.1
  • Rust Version: 1.90.0
  • Memvid Version: 2.0.140
  • Features Enabled: default (lex)

Minimal Reproducible Example

rust
// Both occurrences follow this pattern:
let num_cols = data.iter().map(|r| r.len()).max().unwrap_or(0) as u32;
// Fix: replace |r| r.len() with Vec::len
let num_cols = data.iter().map(Vec::len).max().unwrap_or(0) as u32;

Additional Context

These were introduced in the XLSX pipeline addition and survived a dedicated clippy-fix pass (223b93d), because that pass also didn't use --all-targets.

Consider aligning the CI clippy command with the command documented in CONTRIBUTING.md to prevent similar regressions in test code.

Checklist

  • I have searched existing issues for duplicates
  • I have tested with the latest version
  • I can reproduce this consistently