Skip to content

Commit

Permalink
fix: fq_message_name should begin with one dot
Browse files Browse the repository at this point in the history
When package name is empty, but type_path is filled, the fq_message_name should begin with a single dot.
  • Loading branch information
caspermeijn committed Nov 24, 2023
1 parent 907e9f6 commit 94a3ecf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions prost-build/src/code_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,7 @@ impl<'a> CodeGenerator<'a> {
let message_name = message.name().to_string();
let fq_message_name = format!(
"{}{}{}{}.{}",
if self.package.is_empty() && self.type_path.is_empty() {
""
} else {
"."
},
if self.package.is_empty() { "" } else { "." },
self.package.trim_matches('.'),
if self.type_path.is_empty() { "" } else { "." },
self.type_path.join("."),
Expand Down

0 comments on commit 94a3ecf

Please sign in to comment.