mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-10-30 23:29:50 +00:00
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:
1 parent
5dc356ddb0
commit
63561609a6
4 files changed
+92
-40
No files matched your search
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user