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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user