From 94a3ecfb60662d354d71c57183e95804046d3742 Mon Sep 17 00:00:00 2001 From: Casper Meijn Date: Thu, 23 Nov 2023 17:04:51 +0100 Subject: [PATCH] fix: fq_message_name should begin with one dot When package name is empty, but type_path is filled, the fq_message_name should begin with a single dot. --- prost-build/src/code_generator.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/prost-build/src/code_generator.rs b/prost-build/src/code_generator.rs index a6a06d484..a50e96e4b 100644 --- a/prost-build/src/code_generator.rs +++ b/prost-build/src/code_generator.rs @@ -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("."),