@@ -75,7 +75,6 @@ impl SerField {
75
75
}
76
76
}
77
77
78
-
79
78
fn exclude_if (
80
79
exclude_if_callable : & Option < Py < PyAny > > ,
81
80
value : & Bound < ' _ , PyAny > ,
@@ -92,13 +91,7 @@ fn exclude_if(
92
91
Ok ( false )
93
92
}
94
93
95
-
96
- fn exclude_default (
97
- value : & Bound < ' _ , PyAny > ,
98
- extra : & Extra ,
99
- serializer : & CombinedSerializer ,
100
- ) -> PyResult < bool > {
101
-
94
+ fn exclude_default ( value : & Bound < ' _ , PyAny > , extra : & Extra , serializer : & CombinedSerializer ) -> PyResult < bool > {
102
95
if extra. exclude_defaults {
103
96
if let Some ( default) = serializer. get_default ( value. py ( ) ) ? {
104
97
if value. eq ( default) ? {
@@ -209,12 +202,8 @@ impl GeneralFieldsSerializer {
209
202
if exclude_if ( & field. exclude_if , & value, serializer) ? {
210
203
continue ;
211
204
}
212
- let value = serializer. to_python (
213
- & value,
214
- next_include. as_ref ( ) ,
215
- next_exclude. as_ref ( ) ,
216
- & field_extra,
217
- ) ?;
205
+ let value =
206
+ serializer. to_python ( & value, next_include. as_ref ( ) , next_exclude. as_ref ( ) , & field_extra) ?;
218
207
let output_key = field. get_key_py ( output_dict. py ( ) , & field_extra) ;
219
208
output_dict. set_item ( output_key, value) ?;
220
209
}
@@ -294,9 +283,8 @@ impl GeneralFieldsSerializer {
294
283
if let Some ( ( next_include, next_exclude) ) = filter {
295
284
if let Some ( field) = self . fields . get ( key_str) {
296
285
if let Some ( ref serializer) = field. serializer {
297
- if exclude_default ( & value, & field_extra, serializer)
298
- . map_err ( py_err_se_err) ?{
299
- continue ;
286
+ if exclude_default ( & value, & field_extra, serializer) . map_err ( py_err_se_err) ? {
287
+ continue ;
300
288
}
301
289
if exclude_if ( & field. exclude_if , & value, serializer) . map_err ( py_err_se_err) ? {
302
290
continue ;
0 commit comments