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) <[email protected]>
This commit is contained in:
osobh
2026-09-26 13:11:46 -05:00
co-authored by Claude Opus 5.5
parent 24f0c71939
commit 476960f4b8
+4 -2
View File
@@ -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);