From 2fb556074625fc3c97d8fabe026936c0c04e5b6e Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 4 May 2023 18:41:24 -0700 Subject: [PATCH] Attempt to generate just one copy of TagContentOtherFieldVisitor's field matching --- serde/src/private/de.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/serde/src/private/de.rs b/serde/src/private/de.rs index 411525693..5e1f7ff7c 100644 --- a/serde/src/private/de.rs +++ b/serde/src/private/de.rs @@ -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(self, field: &[u8]) -> Result