Skip to content

Commit

Permalink
fix: add missing pilota_name convert (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Millione authored Jun 24, 2024
1 parent b4b8f7a commit d4be29a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 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.10"
version = "0.11.11"
edition = "2021"
description = "Compile thrift and protobuf idl into rust code at compile-time."
documentation = "https://docs.rs/pilota-build"
Expand Down
14 changes: 8 additions & 6 deletions pilota-build/src/parser/thrift/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ impl ThriftLower {

let mut seen = FxHashSet::default();
let mut duplicate_function_names = FxHashSet::default();
for name in service
.functions
.iter()
.map(|f| f.name.to_upper_camel_case())
{
for name in service.functions.iter().map(|f| {
self.extract_tags(&f.annotations)
.get::<PilotaName>()
.map(|name| &*name.0)
.unwrap_or_else(|| &*f.name)
.to_upper_camel_case()
}) {
if !seen.insert(name.clone()) {
duplicate_function_names.insert(name);
}
Expand Down Expand Up @@ -172,7 +174,7 @@ impl ThriftLower {

let method_name = tags
.get::<PilotaName>()
.map(|name| name.0.to_string())
.map(|name| name.0.to_upper_camel_case())
.unwrap_or_else(|| {
let method_name = f.name.to_upper_camel_case();
if duplicate_function_names.contains(&method_name) {
Expand Down

0 comments on commit d4be29a

Please sign in to comment.