From 2e857d0000ae9f85920d408b177ef10a4c751dbe Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 27 Jul 2022 14:30:50 +0200 Subject: [PATCH] Implement std::error::Error for ParseWeekdayError --- src/weekday.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/weekday.rs b/src/weekday.rs index 58f61f2fcb..03e06570ab 100644 --- a/src/weekday.rs +++ b/src/weekday.rs @@ -191,6 +191,15 @@ 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 {{ .. }}")