Skip to content

Commit

Permalink
serde: skipping unused fields, don't check UTF-8
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michalsrb committed Nov 27, 2020
1 parent e85e89a commit b08b3e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/deserializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ impl<'a, 'de: 'a, T: DeRecord<'de>> Deserializer<'de>
// Read and drop the next field.
// This code is reached, e.g., when trying to deserialize a header
// that doesn't exist in the destination struct.
let _ = self.next_field()?;
let _ = self.next_field_bytes()?;
visitor.visit_unit()
}
}
Expand Down

0 comments on commit b08b3e6

Please sign in to comment.