From 8dcce084ca29d41aaee30a01ec160c22eb9d4eaa Mon Sep 17 00:00:00 2001 From: osobh Date: Sat, 26 Sep 2026 09:05:31 -0500 Subject: [PATCH] test: the v4 chunk-index selection test passes clippy -D warnings A type alias for the hyperslab tuple, and as_chunks for the i32 decode. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/clawhdf5/tests/v4_chunk_index_selection.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/clawhdf5/tests/v4_chunk_index_selection.rs b/crates/clawhdf5/tests/v4_chunk_index_selection.rs index 97cc7c9..23786bd 100644 --- a/crates/clawhdf5/tests/v4_chunk_index_selection.rs +++ b/crates/clawhdf5/tests/v4_chunk_index_selection.rs @@ -122,7 +122,10 @@ const CASES: &[Case] = &[ /// `(start, stride, count, block)` per dimension; the first few stay below /// half the dataset (bounding-box path), the rest exceed it (full path). -fn selections() -> Vec<([u64; 2], [u64; 2], [u64; 2], [u64; 2])> { +/// `(start, stride, count, block)` of a 2-D hyperslab. +type Hyperslab2 = ([u64; 2], [u64; 2], [u64; 2], [u64; 2]); + +fn selections() -> Vec { vec![ ([0, 0], [1, 1], [3, 23], [1, 1]), // ds[0:3] ([7, 3], [1, 1], [9, 6], [1, 1]), // interior window across chunks @@ -220,8 +223,10 @@ fn partial_hyperslabs_of_every_v4_chunk_index_match_h5py() { .read_selection(&sel) .unwrap_or_else(|e| panic!("{}: read_selection {sel:?} failed: {e}", case.name)); let got: Vec = raw - .chunks_exact(4) - .map(|b| i32::from_le_bytes(b.try_into().unwrap())) + .as_chunks::<4>() + .0 + .iter() + .map(|b| i32::from_le_bytes(*b)) .collect(); assert_eq!(got, want, "{}: selection {sel:?}", case.name); assert_eq!(