mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-10-25 13:05:08 +00:00
Merge pull request #2377 from mfro/master
Allow bytes for adjacently tagged enums
This commit is contained in:
2 files changed
+66
No files matched your search
@@ -990,6 +990,19 @@ mod content {
|
||||
Ok(TagContentOtherField::Other)
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_bytes<E>(self, field: &[u8]) -> Result<Self::Value, E>
|
||||
where
|
||||
E: de::Error,
|
||||
{
|
||||
if field == self.tag.as_bytes() {
|
||||
Ok(TagContentOtherField::Tag)
|
||||
} else if field == self.content.as_bytes() {
|
||||
Ok(TagContentOtherField::Content)
|
||||
} else {
|
||||
Ok(TagContentOtherField::Other)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Not public API
|
||||
|
||||
Reference in new issue
Block a user