diff options
Diffstat (limited to 'src/component.rs')
-rw-r--r-- | src/component.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/component.rs b/src/component.rs index a11d38d..a81cc2d 100644 --- a/src/component.rs +++ b/src/component.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use std::collections::BTreeMap; use property::Property; -use parser::Parser; +use parser::{Parser, ParseErrorReason}; use error::*; @@ -81,8 +81,7 @@ impl FromStr for Component { pub fn parse_component(s: &str) -> VObjectResult<Component> { let (rv, new_s) = read_component(s)?; if !new_s.is_empty() { - let s = format!("Trailing data: `{}`", new_s); - return Err(VObjectErrorKind::ParserError(s)); + return Err(ParseErrorReason::TrailingData(new_s.into()).into()); } Ok(rv) |