mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-29 01:27:56 +00:00
Allow bytes for adjantly tagged enums
This commit is contained in:
@@ -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