summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2020-04-08 23:19:37 -0400
committerBen Boeckel <mathstuf@gmail.com>2020-04-09 10:32:48 -0400
commitd0d8bde43fe1355a740c0f431f7b10f4a2715823 (patch)
tree9ae6ded3369ccdee0878b86a5319ecaeb66aaae7
parentf08ee3c272ddf01b1025abb0c8a81fdd15a6bf52 (diff)
error: rename from VObjectErrorKind to VObjectError
The type is a fully-fledged `impl Error` all on its own now.
-rw-r--r--src/component.rs2
-rw-r--r--src/error.rs4
-rw-r--r--src/icalendar.rs2
-rw-r--r--src/vcard.rs2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/component.rs b/src/component.rs
index a81cc2d..f6d9ac0 100644
--- a/src/component.rs
+++ b/src/component.rs
@@ -69,7 +69,7 @@ impl Component {
}
impl FromStr for Component {
- type Err = VObjectErrorKind;
+ type Err = VObjectError;
/// Same as `vobject::parse_component`
fn from_str(s: &str) -> VObjectResult<Component> {
diff --git a/src/error.rs b/src/error.rs
index 4c48e50..8b01844 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -3,7 +3,7 @@ use thiserror::Error;
use ::parser::ParseErrorReason;
#[derive(Debug, Clone, Error)]
-pub enum VObjectErrorKind {
+pub enum VObjectError {
#[error("failed to parse: {}", source)]
Parse {
#[from]
@@ -24,4 +24,4 @@ pub enum VObjectErrorKind {
},
}
-pub(crate) type VObjectResult<T> = Result<T, VObjectErrorKind>;
+pub(crate) type VObjectResult<T> = Result<T, VObjectError>;
diff --git a/src/icalendar.rs b/src/icalendar.rs
index 6a5fea2..4da4802 100644
--- a/src/icalendar.rs
+++ b/src/icalendar.rs
@@ -24,7 +24,7 @@ impl ICalendar {
///
pub fn build(s: &str) -> VObjectResult<ICalendar> {
let c = parse_component(s)?;
- Self::from_component(c).map_err(|_| VObjectErrorKind::NotAnICalendar(s.to_owned()))
+ Self::from_component(c).map_err(|_| VObjectError::NotAnICalendar(s.to_owned()))
}
pub fn empty() -> ICalendar {
diff --git a/src/vcard.rs b/src/vcard.rs
index 1729ede..ec750fa 100644
--- a/src/vcard.rs
+++ b/src/vcard.rs
@@ -25,7 +25,7 @@ impl Vcard {
pub fn build(s: &str) -> VObjectResult<Vcard> {
parse_component(s)
.and_then(|c| {
- Self::from_component(c).map_err(|_| VObjectErrorKind::NotAVCard)
+ Self::from_component(c).map_err(|_| VObjectError::NotAVCard)
})
}