From 0f23e195cae6baa72bfe31360d25b883a69736a6 Mon Sep 17 00:00:00 2001 From: Millione Date: Mon, 24 Jun 2024 15:16:07 +0800 Subject: [PATCH] fix: add missing pilota_name convert --- Cargo.lock | 2 +- pilota-build/Cargo.toml | 2 +- pilota-build/src/parser/thrift/mod.rs | 14 ++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c84a9538..e7ed0ce4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -803,7 +803,7 @@ dependencies = [ [[package]] name = "pilota-build" -version = "0.11.10" +version = "0.11.11" dependencies = [ "ahash", "anyhow", diff --git a/pilota-build/Cargo.toml b/pilota-build/Cargo.toml index e400b6ad..92388720 100644 --- a/pilota-build/Cargo.toml +++ b/pilota-build/Cargo.toml @@ -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" diff --git a/pilota-build/src/parser/thrift/mod.rs b/pilota-build/src/parser/thrift/mod.rs index 080b7173..17a16a14 100644 --- a/pilota-build/src/parser/thrift/mod.rs +++ b/pilota-build/src/parser/thrift/mod.rs @@ -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::() + .map(|name| &*name.0) + .unwrap_or_else(|| &*f.name) + .to_upper_camel_case() + }) { if !seen.insert(name.clone()) { duplicate_function_names.insert(name); } @@ -172,7 +174,7 @@ impl ThriftLower { let method_name = tags .get::() - .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) {