Add Error::length_mismatch, Error::type_mismatch, and de::Type

This improves error handling to match the needs of msgpack
This commit is contained in:
Erick Tryzelaar committed 2015-08-09 21:42:42 -07:00
1 parent 5dc356ddb0
commit 63561609a6
4 files changed
+92 -40

No files matched your search

+2 -2
View File
@@ -843,7 +843,7 @@ impl<'a> de::SeqVisitor for SeqDeserializer<'a> {
if self.len == 0 {
Ok(())
} else {
Err(de::Error::end_of_stream())
Err(de::Error::length_mismatch(self.len))
}
}
@@ -888,7 +888,7 @@ impl<'a> de::MapVisitor for MapDeserializer<'a> {
if self.len == 0 {
Ok(())
} else {
Err(de::Error::end_of_stream())
Err(de::Error::length_mismatch(self.len))
}
}