diff options
author | Markus Unterwaditzer <markus@unterwaditzer.net> | 2015-06-02 15:33:32 +0200 |
---|---|---|
committer | Markus Unterwaditzer <markus@unterwaditzer.net> | 2015-06-02 15:33:32 +0200 |
commit | 54fea0fba5023bb96fe05aeb4cb8537d1585285c (patch) | |
tree | 2a47ec82b80612fbc9a9957fd80d921f105e920b | |
parent | 083620129bd316b5211e61b658a7d2b8a696b975 (diff) |
Improve type signature
-rw-r--r-- | src/vobject/lib.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/vobject/lib.rs b/src/vobject/lib.rs index b2d4cb9..90343c4 100644 --- a/src/vobject/lib.rs +++ b/src/vobject/lib.rs @@ -104,14 +104,11 @@ impl Component { } impl FromStr for Component { - type Err = String; + type Err = ParseError; /// Same as `vobject::parse_component`, but without the error messages. - fn from_str(s: &str) -> Result<Component, String> { - match parse_component(s) { - Ok(x) => Ok(x), - Err(e) => Err(e.into_string()) - } + fn from_str(s: &str) -> ParseResult<Component> { + parse_component(s) } } |