From 476960f4b88c75eb85e19a7e76b3000912afcac6 Mon Sep 17 00:00:00 2001 From: osobh Date: Sat, 26 Sep 2026 13:11:46 -0500 Subject: [PATCH] format: fix a clippy lint in the global heap test fixture With Storage in scope, `data.len()` on a `&&[u8]` resolves to Storage::len (already a u64), so `as u64` was a no-op cast; name the slice method explicitly. Co-Authored-By: Claude Opus 5.5 (1M context) --- crates/clawhdf5-format/src/global_heap.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/clawhdf5-format/src/global_heap.rs b/crates/clawhdf5-format/src/global_heap.rs index c6de363..e635d4f 100644 --- a/crates/clawhdf5-format/src/global_heap.rs +++ b/crates/clawhdf5-format/src/global_heap.rs @@ -296,8 +296,10 @@ mod tests { buf.extend_from_slice(&ref_count.to_le_bytes()); buf.extend_from_slice(&[0u8; 4]); // reserved match length_size { - 4 => buf.extend_from_slice(&(data.len() as u32).to_le_bytes()), - 8 => buf.extend_from_slice(&(data.len() as u64).to_le_bytes()), + // `<[u8]>::len`: with `Storage` in scope `data.len()` on a + // `&&[u8]` resolves to `Storage::len` (a `u64`). + 4 => buf.extend_from_slice(&(<[u8]>::len(data) as u32).to_le_bytes()), + 8 => buf.extend_from_slice(&(<[u8]>::len(data) as u64).to_le_bytes()), _ => panic!("unsupported"), } buf.resize(buf.len() + (pad8(8 + ls) - (8 + ls)), 0);