Inline some encoding and decoding methods.

This is a small performance win.
This commit is contained in:
Nicholas Nethercote 2020-02-19 16:54:36 +11:00
parent 5e7af4669f
commit 139c3cab28
2 changed files with 2 additions and 0 deletions

View File

@ -301,6 +301,7 @@ where
macro_rules! __impl_decoder_methods {
($($name:ident -> $ty:ty;)*) => {
$(
#[inline]
fn $name(&mut self) -> Result<$ty, Self::Error> {
self.opaque.$name()
}

View File

@ -943,6 +943,7 @@ where
macro_rules! encoder_methods {
($($name:ident($ty:ty);)*) => {
#[inline]
$(fn $name(&mut self, value: $ty) -> Result<(), Self::Error> {
self.encoder.$name(value)
})*