mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-10-27 22:09:51 +00:00
Change de::VariantVisitor to let deserializers know the variant kind
This allows formats like cbor that encode a unit variant as just a string to work. [breaking-change]
This commit is contained in:
1 parent
d36879f5ee
commit
1da47c0870
7 files changed
+94
-24
No files matched your search
+11
-1
@@ -315,7 +315,17 @@ impl<'a> de::VariantVisitor for TokenDeserializerVariantVisitor<'a> {
|
||||
de::Deserialize::deserialize(self.de)
|
||||
}
|
||||
|
||||
fn visit_value<V>(&mut self, visitor: V) -> Result<V::Value, Error>
|
||||
fn visit_unit(&mut self) -> Result<(), Error> {
|
||||
de::Deserialize::deserialize(self.de)
|
||||
}
|
||||
|
||||
fn visit_seq<V>(&mut self, visitor: V) -> Result<V::Value, Error>
|
||||
where V: de::Visitor,
|
||||
{
|
||||
de::Deserializer::visit(self.de, visitor)
|
||||
}
|
||||
|
||||
fn visit_map<V>(&mut self, visitor: V) -> Result<V::Value, Error>
|
||||
where V: de::Visitor,
|
||||
{
|
||||
de::Deserializer::visit(self.de, visitor)
|
||||
|
||||
Reference in new issue
Block a user