Skip to content

Commit

Permalink
lang: add stricter checks for interface attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Dec 14, 2023
1 parent 3f71931 commit b4eed4e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lang/syn/src/parser/spl_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ pub fn parse(attrs: &[syn::Attribute]) -> Option<[u8; 8]> {
let interfaces: Vec<[u8; 8]> = attrs
.iter()
.filter_map(|attr| {
if let Ok(Meta::List(meta_list)) = attr.parse_meta() {
if meta_list.path.is_ident("interface") {
if attr.path.is_ident("interface") {
if let Ok(Meta::List(meta_list)) = attr.parse_meta() {
if let Some(NestedMeta::Meta(Meta::Path(path))) = meta_list.nested.first() {
return Some(parse_interface_instruction(path));
}
}
panic!("Failed to parse interface instruction:\n{}", quote::quote!(#attr));
}
None
})
Expand Down

0 comments on commit b4eed4e

Please sign in to comment.