Skip to content

Commit

Permalink
Attempt to generate just one copy of TagContentOtherFieldVisitor's fi…
Browse files Browse the repository at this point in the history
…eld matching
  • Loading branch information
dtolnay committed May 5, 2023
1 parent bd653ab commit 2fb5560
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions serde/src/private/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 2fb5560

Please sign in to comment.