1
Fork 0

Provide copy-free access to raw Decoder bytes

This commit is contained in:
Mark Rousskov 2022-02-22 18:11:59 -05:00
parent da3b2ca956
commit 2098ea6eba
5 changed files with 12 additions and 21 deletions

View file

@ -485,12 +485,12 @@ macro_rules! implement_ty_decoder {
read_f64 -> f64;
read_f32 -> f32;
read_char -> char;
read_str -> Cow<'_, str>;
read_str -> &str;
}
#[inline]
fn read_raw_bytes_into(&mut self, bytes: &mut [u8]) {
self.opaque.read_raw_bytes_into(bytes)
fn read_raw_bytes(&mut self, len: usize) -> &[u8] {
self.opaque.read_raw_bytes(len)
}
}
}