Skip to content

Commit

Permalink
Implement std::error::Error for ParseWeekdayError
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jul 27, 2022
1 parent 26e231a commit 2e857d0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/weekday.rs
Expand Up @@ -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 {{ .. }}")
Expand Down

0 comments on commit 2e857d0

Please sign in to comment.