Function decode_in_place

Source
pub fn decode_in_place(input: &mut [u8]) -> Result<&mut [u8], DecodeError>
Expand description

Take a byte slice containing a tick-encoded ASCII string, and decode it in-place, writing back into the same byte slice. Returns a sub-slice containing just the decoded bytes (the bytes past the returned sub-slice are left unchanged).

ยงExample

let mut buffer = b"bytes: `00`01`02`03".to_vec();
let decoded = tick_encoding::decode_in_place(&mut buffer).unwrap();
assert_eq!(decoded, b"bytes: \x00\x01\x02\x03");