1
Fork 0

Move raw bytes handling to Encoder/Decoder.

This commit is contained in:
Camille GILLOT 2021-03-11 22:06:45 +01:00
parent e5d09fbbe9
commit 09a638820e
9 changed files with 84 additions and 49 deletions

View file

@ -472,6 +472,11 @@ macro_rules! implement_ty_decoder {
read_str -> Cow<'_, str>;
}
#[inline]
fn read_raw_bytes(&mut self, bytes: &mut [std::mem::MaybeUninit<u8>]) -> Result<(), Self::Error> {
self.opaque.read_raw_bytes(bytes)
}
fn error(&mut self, err: &str) -> Self::Error {
self.opaque.error(err)
}

View file

@ -1167,6 +1167,7 @@ where
emit_f32(f32);
emit_char(char);
emit_str(&str);
emit_raw_bytes(&[u8]);
}
}