Permalink
Browse files

Block::serialize(): Use streaming version

  • Loading branch information...
edolstra committed Jan 11, 2019
1 parent 7fe2c72 commit 9465500a99c9ebf276b6fb3d88b28c99a943c350
Showing with 4 additions and 3 deletions.
  1. +4 −3 cardano/src/block/block.rs
@@ -235,9 +235,10 @@ impl chain_core::property::Block for Block {
impl chain_core::property::Serialize for Block {
type Error = cbor_event::Error;

fn serialize<W: std::io::Write>(&self, mut writer: W) -> Result<(), Self::Error> {
let bytes = cbor!(self)?;
writer.write(&bytes)?;
fn serialize<W: std::io::Write>(&self, writer: W) -> Result<(), Self::Error> {
let mut serializer = cbor_event::se::Serializer::new(writer);
serializer.serialize(self)?;
serializer.finalize();
Ok(())
}
}

0 comments on commit 9465500

Please sign in to comment.