diff --git a/src/errors.rs b/src/errors.rs index ad8d3a2..6cffaaa 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -50,7 +50,7 @@ impl fmt::Debug for CapacityError { } /// Error value indicating that capacity is not completely filled -#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] +#[derive(Clone, Eq, Ord, PartialEq, PartialOrd)] pub struct UnderfilledError(ArrayVec); impl UnderfilledError { @@ -63,11 +63,27 @@ impl UnderfilledError { } } +impl fmt::Debug for UnderfilledError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!( + f, + "UnderfilledError: capacity is not filled: expected {}, got {}", + CAP, + self.0.len() + ) + } +} + #[cfg(feature="std")] -impl Error for UnderfilledError {} +impl Error for UnderfilledError {} -impl fmt::Display for UnderfilledError { +impl fmt::Display for UnderfilledError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "capacity is not filled: expected {}, got {}", CAP, self.0.len()) + write!( + f, + "capacity is not filled: expected {}, got {}", + CAP, + self.0.len() + ) } } \ No newline at end of file