Respect #[serde(transparent)] attribute (#17)

This commit is contained in:
Graham Esau 2020-05-16 21:16:59 +01:00
parent 509a1c3b7b
commit 5a28cef598
8 changed files with 121 additions and 5 deletions

View file

@ -38,7 +38,7 @@ fn expr_for_field(field: &Field, allow_ref: bool) -> TokenStream {
}
}
fn type_for_schema(field: &Field, local_id: usize) -> (syn::Type, Option<TokenStream>) {
pub fn type_for_schema(field: &Field, local_id: usize) -> (syn::Type, Option<TokenStream>) {
match &field.attrs.with {
None => (field.ty.to_owned(), None),
Some(WithAttr::Type(ty)) => (ty.to_owned(), None),