Skip to content

Commit dafe30c

Browse files
committed
Update heck (0.3.3 -> 0.4.0), adjust broken APIs
1 parent e1ecbc3 commit dafe30c

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

bindings_generator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ edition = "2018"
1414
debug = []
1515

1616
[dependencies]
17-
heck = "0.3.3"
17+
heck = "0.4.0"
1818
roxmltree = "0.14.1"
1919
proc-macro2 = "1.0.30"
2020
quote = "1.0.10"

bindings_generator/src/api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use heck::CamelCase as _;
1+
use heck::ToPascalCase as _;
22
use proc_macro2::TokenStream;
33
use quote::{format_ident, quote};
44
use std::collections::{HashMap, HashSet};
@@ -38,7 +38,7 @@ impl Api {
3838
api
3939
}
4040

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> {
4242
for class in &self.classes {
4343
if class.name == name {
4444
return Some(class);
@@ -400,7 +400,7 @@ impl Ty {
400400
// Enums may reference known types (above list), check if it's a known type first
401401
let mut split = ty[5..].split("::");
402402
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());
404404
let module = format_ident!("{}", module_name_from_class_name(class_name));
405405
// Is it a known type?
406406
match Ty::from_src(class_name) {

bindings_generator/src/classes.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::class_docs::GodotXmlDocs;
33
use crate::methods;
44
use crate::special_methods;
55

6-
use heck::CamelCase as _;
6+
use heck::ToPascalCase as _;
77
use proc_macro2::TokenStream;
88
use quote::{format_ident, quote};
99

@@ -145,16 +145,16 @@ pub(crate) fn generate_enums(class: &GodotClass) -> TokenStream {
145145

146146
fn generate_enum_name(class_name: &str, enum_name: &str) -> String {
147147
// 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.
150150
// DOFBlurQuality => DofBlurQuality
151151
match enum_name {
152152
"Result" => {
153153
let mut res = String::from(class_name);
154154
res.push_str(enum_name);
155-
res.to_camel_case()
155+
res.to_pascal_case()
156156
}
157-
_ => enum_name.to_camel_case(),
157+
_ => enum_name.to_pascal_case(),
158158
}
159159
}
160160

gdnative-bindings/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ libc = "0.2.104"
2121
bitflags = "1.3.2"
2222

2323
[build-dependencies]
24-
heck = "0.3.3"
24+
heck = "0.4.0"
2525
gdnative_bindings_generator = { path = "../bindings_generator", version = "=0.9.3" }

0 commit comments

Comments
 (0)