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);