diff --git a/implementations/rust/oo/src/packed/reader.rs b/implementations/rust/oo/src/packed/reader.rs index ef86ca5..de30e6d 100644 --- a/implementations/rust/oo/src/packed/reader.rs +++ b/implementations/rust/oo/src/packed/reader.rs @@ -467,7 +467,11 @@ impl<'de, 'src, S: BinarySource<'de>> Reader<'de> for PackedReader<'de, 'src, S> } fn open_annotation(&mut self) -> ReaderResult<()> { - self.next_compound(Tag::Annotation, ExpectedKind::Annotation) + if let Tag::Annotation = Tag::try_from(self.peek_noeof()?)? { + Ok(self.skip()?) + } else { + Err(error::Error::Expected(ExpectedKind::Annotation)) + } } fn close_annotation(&mut self) -> ReaderResult<()> {