pub fn truncate_zero_be_bytes(
mem_bytes: &[u8],
disk_len: usize,
) -> Option<&[u8]>Expand description
Truncates mem_bytes to disk_len, by removing zero bytes from the start of the slice.
Used to discard unused zero bytes during serialization.
Return None if any of the truncated bytes are non-zero
ยงPanics
- if
mem_bytesis shorter thandisk_len.