Skip to content

Commit b08b3e6

Browse files
authored
serde: skipping unused fields, don't check UTF-8
When the deserializer skips unused fields, we don't have to convert them to valid Utf-8 string. This will prevent errors when unused fields are not UTF-8. Removing the check may also improve performance. See also: #198 PR #203
1 parent e85e89a commit b08b3e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/deserializer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ impl<'a, 'de: 'a, T: DeRecord<'de>> Deserializer<'de>
557557
// Read and drop the next field.
558558
// This code is reached, e.g., when trying to deserialize a header
559559
// that doesn't exist in the destination struct.
560-
let _ = self.next_field()?;
560+
let _ = self.next_field_bytes()?;
561561
visitor.visit_unit()
562562
}
563563
}

0 commit comments

Comments
 (0)