From f08ee3c272ddf01b1025abb0c8a81fdd15a6bf52 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 8 Apr 2020 23:18:49 -0400 Subject: error: mark chrono parsing errors as an error source --- src/error.rs | 7 +++++-- src/icalendar.rs | 27 ++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/error.rs b/src/error.rs index 13c268d..4c48e50 100644 --- a/src/error.rs +++ b/src/error.rs @@ -17,8 +17,11 @@ pub enum VObjectErrorKind { NotAnICalendar(String), #[cfg(feature = "timeconversions")] - #[error("{}", _0)] - ChronoError(::chrono::format::ParseError), + #[error("failed to parse time")] + ChronoError { + #[from] + source: chrono::format::ParseError, + }, } pub(crate) type VObjectResult = Result; diff --git a/src/icalendar.rs b/src/icalendar.rs index 4863029..6a5fea2 100644 --- a/src/icalendar.rs +++ b/src/icalendar.rs @@ -166,12 +166,11 @@ pub trait AsDateTime { impl AsDateTime for Dtend { fn as_datetime(&self) -> VObjectResult