aboutsummaryrefslogtreecommitdiff
path: root/src/de.rs
diff options
context:
space:
mode:
authorMatthias Endler <matthias.endler@trivago.com>2017-04-05 21:32:42 +0200
committerMatthias Endler <matthias.endler@trivago.com>2017-04-05 21:56:18 +0200
commit3108d6dc176a58f2cb44f236b87a4c4f61b77de5 (patch)
treea2f607357c284a05ffb656f40c4b6b5ac801c855 /src/de.rs
parent42bc2e368aa6de3598fc3e0e11e7422cc0bd180f (diff)
downloadmilf-rs-3108d6dc176a58f2cb44f236b87a4c4f61b77de5.tar.gz
milf-rs-3108d6dc176a58f2cb44f236b87a4c4f61b77de5.zip
Replace unwrap with expect in public methods
Diffstat (limited to 'src/de.rs')
-rw-r--r--src/de.rs6
1 files changed, 3 insertions, 3 deletions
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))
}
}