Browse Source

lang: Fix detection of Accounts derive (#1530)

Tom Linton 3 years ago
parent
commit
61de9f21e7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lang/syn/src/idl/file.rs

+ 1 - 1
lang/syn/src/idl/file.rs

@@ -353,7 +353,7 @@ fn parse_account_derives(ctx: &CrateContext) -> HashMap<String, AccountsStruct>
     ctx.structs()
     ctx.structs()
         .filter_map(|i_strct| {
         .filter_map(|i_strct| {
             for attr in &i_strct.attrs {
             for attr in &i_strct.attrs {
-                if attr.tokens.to_string().contains(DERIVE_NAME) {
+                if attr.path.is_ident("derive") && attr.tokens.to_string().contains(DERIVE_NAME) {
                     let strct = accounts::parse(i_strct).expect("Code not parseable");
                     let strct = accounts::parse(i_strct).expect("Code not parseable");
                     return Some((strct.ident.to_string(), strct));
                     return Some((strct.ident.to_string(), strct));
                 }
                 }