diff options
Diffstat (limited to 'src/parser.rs')
-rw-r--r-- | src/parser.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/parser.rs b/src/parser.rs index ce3571e..e1d784d 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,5 +1,6 @@ use std::char; use std::collections::{TreeMap, HashSet}; +use std::error::Error; use std::num::FromStrRadix; use std::str; @@ -760,6 +761,11 @@ impl<'a> Parser<'a> { } } +impl Error for ParserError { + fn description(&self) -> &str { "TOML parse error" } + fn detail(&self) -> Option<String> { Some(self.desc.clone()) } +} + #[cfg(test)] mod tests { use {Table, Parser}; |