diff --git a/ciborium/src/de/mod.rs b/ciborium/src/de/mod.rs index 15545b4..ddfc7b1 100644 --- a/ciborium/src/de/mod.rs +++ b/ciborium/src/de/mod.rs @@ -333,6 +333,12 @@ where } } + // Longer strings require alloaction; delegate to `deserialize_string` + item @ Header::Text(_) => { + self.decoder.push(item); + self.deserialize_string(visitor) + } + header => Err(header.expected("str")), }; } @@ -371,6 +377,12 @@ where visitor.visit_bytes(&self.scratch[..len]) } + // Longer byte sequences require alloaction; delegate to `deserialize_byte_buf` + item @ Header::Bytes(_) => { + self.decoder.push(item); + self.deserialize_byte_buf(visitor) + } + Header::Array(len) => self.recurse(|me| { let access = Access(me, len); visitor.visit_seq(access)