mirror of
https://github.com/danog/strum.git
synced 2024-11-26 20:14:40 +01:00
Raise an error un malformed strum attributes (#119)
This commit is contained in:
parent
1d2778842b
commit
7e64a470b1
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user