Skip to content

Commit

Permalink
Merge branch 'main' into fix/idl_parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Ggiggle authored Nov 5, 2024
2 parents 29a6569 + 376d69d commit cce7dfe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pilota-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilota-build"
version = "0.11.23"
version = "0.11.24"
edition = "2021"
description = "Compile thrift and protobuf idl into rust code at compile-time."
documentation = "https://docs.rs/pilota-build"
Expand Down
9 changes: 4 additions & 5 deletions pilota-build/src/parser/thrift/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,15 @@ impl ThriftLower {
service.name.to_upper_camel_case()
};

let mut function_names: FxHashMap<String, Vec<String>> = FxHashMap::default();
let mut function_names: FxHashMap<FastStr, Vec<String>> = FxHashMap::default();
service.functions.iter().for_each(|func| {
let name = self
.extract_tags(&func.annotations)
.get::<PilotaName>()
.map(|name| name.0.to_string())
.unwrap_or_else(|| func.name.to_string());
let ident = Ident::from(name.clone());
function_names
.entry(ident.to_upper_camel_case())
.entry(name.as_str().upper_camel_ident())
.or_default()
.push(name);
});
Expand Down Expand Up @@ -192,7 +191,7 @@ impl ThriftLower {
.map(|name| name.0.clone())
.unwrap_or_else(|| FastStr::new(f.name.0.clone()));

let upper_camel_ident = f.name.as_str().upper_camel_ident();
let upper_camel_ident = name.as_str().upper_camel_ident();
let method_name = if function_name_duplicates.contains(upper_camel_ident.as_str()) {
name
} else {
Expand Down Expand Up @@ -303,7 +302,7 @@ impl ThriftLower {
.map(|name| name.0.clone())
.unwrap_or_else(|| FastStr::new(method.name.0.clone()));

let upper_camel_ident = method.name.as_str().upper_camel_ident();
let upper_camel_ident = name.as_str().upper_camel_ident();
let method_name = if function_name_duplicates.contains(upper_camel_ident.as_str()) {
name
} else {
Expand Down

0 comments on commit cce7dfe

Please sign in to comment.