aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--src/de.rs6
-rw-r--r--src/value.rs2
3 files changed, 5 insertions, 6 deletions
diff --git a/README.md b/README.md
index dfd11ac..cde8f60 100644
--- a/README.md
+++ b/README.md
@@ -3,8 +3,7 @@
[![Build Status](https://travis-ci.org/alexcrichton/toml-rs.svg?branch=master)](https://travis-ci.org/alexcrichton/toml-rs)
[![Coverage Status](https://coveralls.io/repos/alexcrichton/toml-rs/badge.svg?branch=master&service=github)](https://coveralls.io/github/alexcrichton/toml-rs?branch=master)
[![Latest Version](https://img.shields.io/crates/v/toml.svg)](https://crates.io/crates/toml)
-
-[Documentation](https://docs.rs/toml)
+[![Documentation](https://docs.rs/toml/badge.svg)](https://docs.rs/toml)
A [TOML][toml] decoder and encoder for Rust. This library is currently compliant
with the v0.4.0 version of TOML. This library will also likely continue to stay
diff --git a/src/de.rs b/src/de.rs
index 1fb2eb5..42cf86c 100644
--- a/src/de.rs
+++ b/src/de.rs
@@ -285,7 +285,7 @@ impl<'a, 'b> de::MapVisitor for MapVisitor<'a, 'b> {
return Err(self.de.error(table.at, kind))
}
- self.values = table.values.take().unwrap().into_iter();
+ self.values = table.values.take().expect("Unable to read table values").into_iter();
}
}
@@ -346,7 +346,7 @@ impl<'a, 'b> de::SeqVisitor for MapVisitor<'a, 'b> {
.unwrap_or(self.max);
let ret = seed.deserialize(MapVisitor {
- values: self.tables[self.cur_parent].values.take().unwrap().into_iter(),
+ values: self.tables[self.cur_parent].values.take().expect("Unable to read table values").into_iter(),
next_value: None,
depth: self.depth + 1,
cur_parent: self.cur_parent,
@@ -569,7 +569,7 @@ impl<'a> de::MapVisitor for InlineTableDeserializer<'a> {
fn visit_value_seed<V>(&mut self, seed: V) -> Result<V::Value, Error>
where V: de::DeserializeSeed,
{
- let value = self.next_value.take().unwrap();
+ let value = self.next_value.take().expect("Unable to read table values");
seed.deserialize(ValueDeserializer::new(value))
}
}
diff --git a/src/value.rs b/src/value.rs
index 3a366d8..5c59437 100644
--- a/src/value.rs
+++ b/src/value.rs
@@ -337,7 +337,7 @@ impl<'s, T: ?Sized> Index for &'s T where T: Index {
impl fmt::Display for Value {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- ::ser::to_string(self).unwrap().fmt(f)
+ ::ser::to_string(self).expect("Unable to represent value as string").fmt(f)
}
}