diff options
author | Alex Crichton <alex@alexcrichton.com> | 2015-03-09 11:09:07 -0700 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-09 11:09:07 -0700 |
commit | ff3bb7d25505a565f8bdfd73b1105ae15a1e6f4b (patch) | |
tree | 8a4ea1156fb932cc8dc72171c6d81450ea24d52f /src/lib.rs | |
parent | e14c2052b721d4f400f240e5711ed9510dd1b102 (diff) | |
download | milf-rs-ff3bb7d25505a565f8bdfd73b1105ae15a1e6f4b.tar.gz milf-rs-ff3bb7d25505a565f8bdfd73b1105ae15a1e6f4b.zip |
Reduce usage of unstable features
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -34,10 +34,9 @@ //! //! [1]: https://github.com/mojombo/toml //! [2]: https://github.com/BurntSushi/toml-test -//! #![doc(html_root_url = "http://alexcrichton.com/toml-rs")] -#![feature(collections, core)] +#![feature(core)] #![deny(missing_docs)] #![cfg_attr(test, deny(warnings))] @@ -209,7 +208,10 @@ impl FromStr for Value { type Err = Vec<ParserError>; fn from_str(s: &str) -> Result<Value, Vec<ParserError>> { let mut p = Parser::new(s); - p.parse().map(Value::Table).ok_or(p.errors) + match p.parse().map(Value::Table) { + Some(n) => Ok(n), + None => Err(p.errors), + } } } |