Begin refactor for less allocation

This commit is contained in:
Paul Hauner
2019-05-06 08:47:49 +10:00
parent acf854f558
commit daf6912d18
6 changed files with 82 additions and 68 deletions

View File

@@ -27,9 +27,11 @@ pub fn ssz_encode<T>(val: &T) -> Vec<u8>
where
T: Encodable,
{
let mut ssz_stream = SszStream::new();
ssz_stream.append(val);
ssz_stream.drain()
let mut buf = vec![];
val.ssz_append(&mut buf);
buf
}
/*