mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 21:04:41 +00:00
Remove panics from packed_encoding
This commit is contained in:
@@ -55,8 +55,8 @@ impl CachedTreeHash<Inner> for Inner {
|
||||
BTreeOverlay::from_lengths(chunk_offset, lengths)
|
||||
}
|
||||
|
||||
fn packed_encoding(&self) -> Vec<u8> {
|
||||
panic!("Struct should never be packed")
|
||||
fn packed_encoding(&self) -> Result<Vec<u8>, Error> {
|
||||
Err(Error::ShouldNeverBePacked(Self::item_type()))
|
||||
}
|
||||
|
||||
fn packing_factor() -> usize {
|
||||
@@ -133,8 +133,8 @@ impl CachedTreeHash<Outer> for Outer {
|
||||
BTreeOverlay::from_lengths(chunk_offset, lengths)
|
||||
}
|
||||
|
||||
fn packed_encoding(&self) -> Vec<u8> {
|
||||
panic!("Struct should never be packed")
|
||||
fn packed_encoding(&self) -> Result<Vec<u8>, Error> {
|
||||
Err(Error::ShouldNeverBePacked(Self::item_type()))
|
||||
}
|
||||
|
||||
fn packing_factor() -> usize {
|
||||
|
||||
Reference in New Issue
Block a user