Records and sequences don't need a pushed state
This commit is contained in:
parent
0ffb44e8cb
commit
d5dd02356b
|
@ -140,8 +140,6 @@ impl<W: io::Write> Writer for PackedWriter<W>
|
|||
fn boundary(&mut self, b: &B::Type) -> io::Result<()> {
|
||||
match b.closing {
|
||||
Some(B::Item::DictionaryValue) |
|
||||
Some(B::Item::RecordField) |
|
||||
Some(B::Item::SequenceValue) |
|
||||
Some(B::Item::SetValue) =>
|
||||
self.shift(),
|
||||
_ =>
|
||||
|
@ -336,25 +334,21 @@ impl<W: io::Write> Writer for PackedWriter<W>
|
|||
|
||||
#[inline(always)]
|
||||
fn start_record(&mut self) -> io::Result<()> {
|
||||
self.write_tag(Tag::Record)?;
|
||||
self.push()
|
||||
self.write_tag(Tag::Record)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn end_record(&mut self) -> io::Result<()> {
|
||||
self.pop(false)?;
|
||||
self.write_tag(Tag::End)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn start_sequence(&mut self) -> io::Result<()> {
|
||||
self.write_tag(Tag::Sequence)?;
|
||||
self.push()
|
||||
self.write_tag(Tag::Sequence)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn end_sequence(&mut self) -> io::Result<()> {
|
||||
self.pop(false)?;
|
||||
self.write_tag(Tag::End)
|
||||
}
|
||||
|
||||
|
@ -384,8 +378,7 @@ impl<W: io::Write> Writer for PackedWriter<W>
|
|||
|
||||
#[inline(always)]
|
||||
fn start_embedded(&mut self) -> io::Result<()> {
|
||||
self.write_tag(Tag::Embedded)?;
|
||||
Ok(())
|
||||
self.write_tag(Tag::Embedded)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
|
Loading…
Reference in New Issue