diff options
author | Ben Boeckel <mathstuf@gmail.com> | 2020-04-08 22:45:18 -0400 |
---|---|---|
committer | Ben Boeckel <mathstuf@gmail.com> | 2020-04-09 10:32:09 -0400 |
commit | 3dd9ceec1152d489bb72fbfbb506fc628baa1b1a (patch) | |
tree | d1d0a7833777bcedf69f36dedb655ca8e40228a0 /src/error.rs | |
parent | cd1c566c8a68b097235e57267b8106ceee150e2a (diff) |
thiserror: replace usage of failure
`thiserror` is much lighter and doesn't export a dependency on `failure`
to consumers of the crate.
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/error.rs b/src/error.rs index 28f39e0..d98e716 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,16 +1,18 @@ -#[derive(Debug, Clone, Eq, PartialEq, Fail)] +use thiserror::Error; + +#[derive(Debug, Clone, Error)] pub enum VObjectErrorKind { - #[fail(display = "Parser error: {}", _0)] + #[error("Parser error: {}", _0)] ParserError(String), - #[fail(display = "Not a Vcard")] + #[error("Not a Vcard")] NotAVCard, - #[fail(display = "Not a Icalendar: {}", _0)] + #[error("Not a Icalendar: {}", _0)] NotAnICalendar(String), #[cfg(feature = "timeconversions")] - #[fail(display = "{}", _0)] + #[error("{}", _0)] ChronoError(::chrono::format::ParseError), } |