Skip to content

Commit

Permalink
Fixes failure tests resulting in stack overflow error. (#5)
Browse files Browse the repository at this point in the history
Co-authored-by: claravanstaden <Cats 4 life!>
  • Loading branch information
claravanstaden authored and claravanstaden committed Nov 22, 2022
1 parent 40e5c4a commit dd0540b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ssz-rs/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ pub enum DeserializeError {
IllegalType { bound: usize }, // the type for this value has an illegal bound of {bound}
}

impl Debug for DeserializeError {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
write!(f, "{:?}", self)
}
}

impl Display for DeserializeError {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
write!(f, "{:?}", self)
match *self {
DeserializeError::InputTooShort => write!(f, "InputTooShort"),
DeserializeError::ExtraInput => write!(f, "ExtraInput"),
DeserializeError::InvalidInput => write!(f, "InvalidInput"),
DeserializeError::IOError => write!(f, "IOError"),
DeserializeError::TypeBoundsViolated { bound, len } => write!(f, "TypeBoundsViolated bound: {} len {}", bound, len),
DeserializeError::IllegalType { bound } => write!(f, "IllegalType bound: {}", bound),
}
}
}

Expand Down

0 comments on commit dd0540b

Please sign in to comment.