Browse Source

lang: Render event IDL fields as mixed case (#379)

Ian Macalinao 4 years ago
parent
commit
4ce26d5531
2 changed files with 5 additions and 1 deletions
  1. 4 0
      CHANGELOG.md
  2. 1 1
      lang/syn/src/idl/file.rs

+ 4 - 0
CHANGELOG.md

@@ -11,6 +11,10 @@ incremented for features.
 
 ## [Unreleased]
 
+### Breaking
+
+* lang: Event field names in IDLs are now mixed case. ([#379](https://github.com/project-serum/anchor/pull/379)).
+
 ## [0.8.0] - 2021-06-10
 
 ### Features

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

@@ -186,7 +186,7 @@ pub fn parse(filename: impl AsRef<Path>) -> Result<Idl> {
                         Some(i) => parser::tts_to_string(&i.path) == "index",
                     };
                     IdlEventField {
-                        name: f.ident.clone().unwrap().to_string(),
+                        name: f.ident.clone().unwrap().to_string().to_mixed_case(),
                         ty: parser::tts_to_string(&f.ty).to_string().parse().unwrap(),
                         index,
                     }