Remove panics from packed_encoding

This commit is contained in:
Paul Hauner
2019-04-15 11:49:50 +10:00
parent e6c33e1b60
commit cb9b59b93d
3 changed files with 17 additions and 14 deletions

View File

@@ -23,6 +23,7 @@ pub enum Error {
UnableToObtainSlices,
UnableToGrowMerkleTree,
UnableToShrinkMerkleTree,
ShouldNeverBePacked(ItemType),
BytesAreNotEvenChunks(usize),
NoModifiedFieldForChunk(usize),
NoBytesForChunk(usize),
@@ -47,7 +48,7 @@ pub trait CachedTreeHash<Item>: Debug {
fn btree_overlay(&self, chunk_offset: usize) -> Result<BTreeOverlay, Error>;
fn packed_encoding(&self) -> Vec<u8>;
fn packed_encoding(&self) -> Result<Vec<u8>, Error>;
fn packing_factor() -> usize;