Implement Serialize for flexbuffer::Reader (#6635)

* Implement Serialize for flexbuffer::Reader

* bump version

* Remove use of experimantal or-patterns

* Remove more use of experimantal or-patterns

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-05-10 23:15:46 -04:00
committed by GitHub
parent a1730fcea8
commit 8fd10606c1
9 changed files with 125 additions and 40 deletions

View File

@@ -36,6 +36,10 @@ impl FlexbufferSerializer {
pub fn take_buffer(&mut self) -> Vec<u8> {
self.builder.take_buffer()
}
pub fn reset(&mut self) {
self.builder.reset();
self.nesting.clear();
}
fn finish_if_not_nested(&mut self) -> Result<(), Error> {
if self.nesting.is_empty() {
assert_eq!(self.builder.values.len(), 1);