test(io): read the cache-image fixture's values with as_chunks
clippy (with the async feature) flags chunks_exact with a constant size
in the AsyncHDF5File cache-image test added in d493d47.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
@@ -455,8 +455,10 @@ mod tests {
|
|||||||
assert_eq!(info.shape, [50, 100]);
|
assert_eq!(info.shape, [50, 100]);
|
||||||
let values: Vec<i32> = info
|
let values: Vec<i32> = info
|
||||||
.raw
|
.raw
|
||||||
.chunks_exact(4)
|
.as_chunks::<4>()
|
||||||
.map(|b| i32::from_le_bytes(b.try_into().unwrap()))
|
.0
|
||||||
|
.iter()
|
||||||
|
.map(|&b| i32::from_le_bytes(b))
|
||||||
.collect();
|
.collect();
|
||||||
let expected: Vec<i32> = (0..50).flat_map(|i| (0..100).map(move |j| i * j)).collect();
|
let expected: Vec<i32> = (0..50).flat_map(|i| (0..100).map(move |j| i * j)).collect();
|
||||||
assert_eq!(values, expected);
|
assert_eq!(values, expected);
|
||||||
|
|||||||
Reference in New Issue
Block a user