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
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -982,13 +982,7 @@ mod content {
where where
E: de::Error, E: de::Error,
{ {
if field == self.tag { self.visit_bytes(field.as_bytes())
Ok(TagContentOtherField::Tag)
} else if field == self.content {
Ok(TagContentOtherField::Content)
} else {
Ok(TagContentOtherField::Other)
}
} }
fn visit_bytes<E>(self, field: &[u8]) -> Result<Self::Value, E> fn visit_bytes<E>(self, field: &[u8]) -> Result<Self::Value, E>