prost
prost copied to clipboard
Add test cases for decoding varint in a split Buf
#530 shouldn't pass the tests. As I've said in a comment there, Buf may be split across multiple chunks and all the bytes for the varint we're decoding are not guaranteed to be in the first one.
This is an edge case, but by taking in &mut Buf the function is obligated to handle this case.
Perhaps adding a separate function, something like a thin wrapper around decode_varint_slice would be a better option if memory is guaranteed to be contiguous?