From 634ffbd54026110fa95bbbfd485331aedb5cdb03 Mon Sep 17 00:00:00 2001 From: Thomas BESSOU Date: Wed, 13 Nov 2024 02:32:16 +0100 Subject: [PATCH] optimize some more ignored_any --- serde_avro_fast/src/de/deserializer/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/serde_avro_fast/src/de/deserializer/mod.rs b/serde_avro_fast/src/de/deserializer/mod.rs index f7a83c3..1c3bcab 100644 --- a/serde_avro_fast/src/de/deserializer/mod.rs +++ b/serde_avro_fast/src/de/deserializer/mod.rs @@ -431,6 +431,20 @@ impl<'de, R: ReadSlice<'de>> Deserializer<'de> for DatumDeserializer<'_, '_, R> elements_schema: elements_schema.as_ref(), block_reader: BlockReader::new(self.state, true, self.allowed_depth.dec()?), }), + SchemaNode::Int => { + // Skip zigzag decoding + let _: u32 = self.state.read_varint()?; + visitor.visit_unit() + } + SchemaNode::Long | SchemaNode::Enum(_) => { + // Skip zigzag decoding + let _: u64 = self.state.read_varint()?; + visitor.visit_unit() + } + SchemaNode::Duration => { + self.state.read_const_size_buf::<12>()?; + visitor.visit_unit() + } _ => self.deserialize_any(visitor), } }