mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-24 21:37:57 +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:
@@ -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