Skip to content

Commit

Permalink
Update src/serializers/fields.rs
Browse files Browse the repository at this point in the history
Co-authored-by: David Hewitt <[email protected]>
  • Loading branch information
sneakers-the-rat and davidhewitt authored Oct 22, 2024
1 parent 85cb502 commit e80518a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/serializers/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@ impl SerField {
fn exclude_default(value: &Bound<'_, PyAny>, extra: &Extra, serializer: &CombinedSerializer) -> PyResult<bool> {
if extra.exclude_defaults {
if let Some(default) = serializer.get_default(value.py())? {
return match value.eq(default) {
Ok(true) => Ok(true),
Ok(false) => Ok(false),
Err(_e) => Ok(false),
};
return Ok(value.eq(default).unwrap_or(false));
}
}
Ok(false)
Expand Down

0 comments on commit e80518a

Please sign in to comment.