Attempt to generate just one copy of TagContentOtherFieldVisitor's field matching

This commit is contained in:
David Tolnay
2023-05-04 18:41:24 -07:00
parent bd653ab30c
commit 2fb5560746
+1 -7
View File
@@ -982,13 +982,7 @@ mod content {
where
E: de::Error,
{
if field == self.tag {
Ok(TagContentOtherField::Tag)
} else if field == self.content {
Ok(TagContentOtherField::Content)
} else {
Ok(TagContentOtherField::Other)
}
self.visit_bytes(field.as_bytes())
}
fn visit_bytes<E>(self, field: &[u8]) -> Result<Self::Value, E>