Method
unpad_blocks
(blocks: &[Array<u8, BlockSize>])
Source from the content-addressed store, hash-verified
| 133 | |
| 134 | #[inline] |
| 135 | fn unpad_blocks<BlockSize: ArraySize>(blocks: &[Array<u8, BlockSize>]) -> Result<&[u8], Error> { |
| 136 | let buf = Array::slice_as_flattened(blocks); |
| 137 | for i in (0..buf.len()).rev() { |
| 138 | if buf[i] != 0 { |
| 139 | return Ok(&buf[..i + 1]); |
| 140 | } |
| 141 | } |
| 142 | Ok(&buf[..0]) |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | /// Pad block with bytes with value equal to the number of bytes added. |
Callers
nothing calls this directly
Tested by
no test coverage detected