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 8e4ef1a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/weekday.rs
Expand Up @@ -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()
}
}

Expand Down

0 comments on commit 8e4ef1a

Please sign in to comment.