aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-09 11:09:07 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-09 11:09:07 -0700
commitff3bb7d25505a565f8bdfd73b1105ae15a1e6f4b (patch)
tree8a4ea1156fb932cc8dc72171c6d81450ea24d52f /src/lib.rs
parente14c2052b721d4f400f240e5711ed9510dd1b102 (diff)
downloadmilf-rs-ff3bb7d25505a565f8bdfd73b1105ae15a1e6f4b.tar.gz
milf-rs-ff3bb7d25505a565f8bdfd73b1105ae15a1e6f4b.zip
Reduce usage of unstable features
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index afc102d..5c5fa91 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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),
+ }
}
}