File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ edition = "2018"
14
14
debug = []
15
15
16
16
[dependencies ]
17
- heck = " 0.3.3 "
17
+ heck = " 0.4.0 "
18
18
roxmltree = " 0.14.1"
19
19
proc-macro2 = " 1.0.30"
20
20
quote = " 1.0.10"
Original file line number Diff line number Diff line change 1
- use heck:: CamelCase as _;
1
+ use heck:: ToPascalCase as _;
2
2
use proc_macro2:: TokenStream ;
3
3
use quote:: { format_ident, quote} ;
4
4
use std:: collections:: { HashMap , HashSet } ;
@@ -38,7 +38,7 @@ impl Api {
38
38
api
39
39
}
40
40
41
- pub fn find_class < ' a , ' b > ( & ' a self , name : & ' b str ) -> Option < & ' a GodotClass > {
41
+ pub fn find_class ( & self , name : & str ) -> Option < & GodotClass > {
42
42
for class in & self . classes {
43
43
if class. name == name {
44
44
return Some ( class) ;
@@ -400,7 +400,7 @@ impl Ty {
400
400
// Enums may reference known types (above list), check if it's a known type first
401
401
let mut split = ty[ 5 ..] . split ( "::" ) ;
402
402
let class_name = split. next ( ) . unwrap ( ) ;
403
- let name = format_ident ! ( "{}" , split. next( ) . unwrap( ) . to_camel_case ( ) ) ;
403
+ let name = format_ident ! ( "{}" , split. next( ) . unwrap( ) . to_pascal_case ( ) ) ;
404
404
let module = format_ident ! ( "{}" , module_name_from_class_name( class_name) ) ;
405
405
// Is it a known type?
406
406
match Ty :: from_src ( class_name) {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use crate::class_docs::GodotXmlDocs;
3
3
use crate :: methods;
4
4
use crate :: special_methods;
5
5
6
- use heck:: CamelCase as _;
6
+ use heck:: ToPascalCase as _;
7
7
use proc_macro2:: TokenStream ;
8
8
use quote:: { format_ident, quote} ;
9
9
@@ -145,16 +145,16 @@ pub(crate) fn generate_enums(class: &GodotClass) -> TokenStream {
145
145
146
146
fn generate_enum_name ( class_name : & str , enum_name : & str ) -> String {
147
147
// In order to not pollute the API with more Result types,
148
- // rename the Result enum used by Search to SearchResult
149
- // to_camel_case () is used to make the enums more Rust like.
148
+ // rename the Result enum used by Search to SearchResult.
149
+ // to_pascal_case () is used to make the enums more rust- like.
150
150
// DOFBlurQuality => DofBlurQuality
151
151
match enum_name {
152
152
"Result" => {
153
153
let mut res = String :: from ( class_name) ;
154
154
res. push_str ( enum_name) ;
155
- res. to_camel_case ( )
155
+ res. to_pascal_case ( )
156
156
}
157
- _ => enum_name. to_camel_case ( ) ,
157
+ _ => enum_name. to_pascal_case ( ) ,
158
158
}
159
159
}
160
160
Original file line number Diff line number Diff line change @@ -21,5 +21,5 @@ libc = "0.2.104"
21
21
bitflags = " 1.3.2"
22
22
23
23
[build-dependencies ]
24
- heck = " 0.3.3 "
24
+ heck = " 0.4.0 "
25
25
gdnative_bindings_generator = { path = " ../bindings_generator" , version = " =0.9.3" }
You can’t perform that action at this time.
0 commit comments