Skip to content

Commit

Permalink
Raise an error un malformed strum attributes (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Sep 29, 2020
1 parent 1d27788 commit 7e64a47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion strum_macros/src/helpers/has_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ fn get_metadata_inner<'a>(
it: impl IntoIterator<Item = &'a syn::Attribute>,
) -> Vec<syn::Meta> {
it.into_iter()
.filter_map(|attr| attr.parse_meta().ok())
.filter(|attr| attr.path.is_ident(ident))
.map(|attr| attr.parse_meta().unwrap())
.filter_map(|meta| match meta {
syn::Meta::List(syn::MetaList { path, nested, .. }) => {
if path.is_ident(ident) {
Expand Down

0 comments on commit 7e64a47

Please sign in to comment.