Rust: drain the header peek so rmp-serde accepts the array

The peek left snapshot slots unread and rmp-serde refused the length
mismatch, so every store fell through to the legacy decode.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-29 02:34:11 +02:00
commit 36aa8d8791

View file

@ -330,6 +330,7 @@ fn store_header(bytes: &[u8]) -> Option<String> {
let header: String = seq
.next_element()?
.ok_or_else(|| <A::Error as serde::de::Error>::invalid_length(0, &self))?;
while seq.next_element::<serde::de::IgnoredAny>()?.is_some() {}
Ok(Header(header))
}
}