diff --git a/src/weekday.rs b/src/weekday.rs index 58f61f2fcb..a252cf352d 100644 --- a/src/weekday.rs +++ b/src/weekday.rs @@ -191,9 +191,18 @@ pub struct ParseWeekdayError { pub(crate) _dummy: (), } +#[cfg(feature = "std")] +impl std::error::Error for ParseWeekdayError {} + +impl fmt::Display for ParseWeekdayError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_fmt(format_args!("{:?}", self)) + } +} + impl fmt::Debug for ParseWeekdayError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "ParseWeekdayError {{ .. }}") + f.debug_struct("ParseWeekdayError").finish_non_exhaustive() } }