summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vobject/lib.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/vobject/lib.rs b/src/vobject/lib.rs
index fba6028..1c3ceba 100644
--- a/src/vobject/lib.rs
+++ b/src/vobject/lib.rs
@@ -90,12 +90,11 @@ impl Component {
}
impl FromStr for Component {
+ type Err = String;
+
/// Same as `vobject::parse_component`, but without the error messages.
- fn from_str(s: &str) -> Option<Component> {
- match parse_component(s) {
- Ok(x) => Some(x),
- Err(_) => None
- }
+ fn from_str(s: &str) -> Result<Component, String> {
+ parse_component(s)
}
}