File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -94,14 +94,15 @@ pub fn phf_map(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
94
94
/// Panic if the first attribute isn’t `#[foo(…)]` with the given name,
95
95
/// or return the parameters.
96
96
fn list_attr < ' a > ( input : & ' a syn:: DeriveInput , expected_name : & str ) -> & ' a [ syn:: NestedMetaItem ] {
97
- match input. attrs [ 0 ] . value {
98
- syn :: MetaItem :: List ( ref name , ref nested ) if name == expected_name => {
99
- nested
100
- }
101
- _ => {
102
- panic ! ( "expected a {} attribute" , expected_name )
97
+ for attr in & input. attrs {
98
+ match attr . value {
99
+ syn :: MetaItem :: List ( ref name , ref nested) if name == expected_name => {
100
+ return nested
101
+ }
102
+ _ => { }
103
103
}
104
104
}
105
+ panic ! ( "expected a {} attribute" , expected_name)
105
106
}
106
107
107
108
/// Panic if `sub_attr` is not a name-value like `foo = "…"` with the given name,
You can’t perform that action at this time.
0 commit comments