Skip to content

Commit

Permalink
Use as instead of immediately-invoked typed function
Browse files Browse the repository at this point in the history
  • Loading branch information
GREsau committed May 15, 2022
1 parent c66e2bd commit f997a43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion schemars_derive/src/schema_exprs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ fn field_default_expr(field: &Field, container_has_default: bool) -> Option<Toke
quote!(container_default.#member)
}
SerdeDefault::Default => quote!(<#ty>::default()),
SerdeDefault::Path(path) => quote!(|| -> #ty { #path() }()),
SerdeDefault::Path(path) => quote!({ #path() as #ty }),
};

let default_expr = match field.serde_attrs.skip_serializing_if() {
Expand Down

0 comments on commit f997a43

Please sign in to comment.