Ignore skipped fields

This commit is contained in:
Osspial
2018-04-09 23:43:49 -04:00
parent c413775574
commit fd14332729
3 changed files with 22 additions and 10 deletions
+7 -1
View File
@@ -126,7 +126,13 @@ fn build_generics(cont: &Container, borrowed: &BorrowedLifetimes) -> syn::Generi
let delife = borrowed.de_lifetime();
let de_bound = parse_quote!(_serde::Deserialize<#delife>);
let generics = bound::with_where_predicates_from_fields(cont, &generics, &de_bound, attr::Field::de_bound, attr::Field::deserialize_with);
let generics = bound::with_where_predicates_from_fields(
cont,
&generics,
&de_bound,
attr::Field::de_bound,
|field| field.deserialize_with().is_none() && !field.skip_deserializing()
);
match cont.attrs.de_bound() {
Some(predicates) => bound::with_where_predicates(&generics, predicates),