diff options
| -rw-r--r-- | validator_derive/src/lib.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/validator_derive/src/lib.rs b/validator_derive/src/lib.rs index 0ad26a9..735ac44 100644 --- a/validator_derive/src/lib.rs +++ b/validator_derive/src/lib.rs @@ -313,12 +313,11 @@ fn find_struct_validation(struct_attrs: &Vec<syn::Attribute>) -> Option<SchemaVa }; for attr in struct_attrs { + if attr.value.name() != "validate" { + continue; + } match attr.value { syn::MetaItem::List(ref ident, ref meta_items) => { - if ident != "validate" { - continue; - } - match meta_items[0] { syn::NestedMetaItem::MetaItem(ref item) => match item { &syn::MetaItem::List(ref ident2, ref args) => { |
