-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fq_message_name should begin with one dot (#981)
When package name is empty, but type_path is filled, the fq_message_name should begin with a single dot. Two duplicate implementations are moved to a separate function. A test is added that creates a sub message without a package name. The code generator uses the message name to generate a rust module path, which is invalid. fixes: #843
- Loading branch information
1 parent
7f1c303
commit a4538f2
Showing
5 changed files
with
34 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
syntax = "proto3"; | ||
|
||
message M { | ||
message SubMessage { | ||
map<string, string> item = 1; | ||
} | ||
SubMessage reply = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include!(concat!(env!("OUT_DIR"), "/_.rs")); | ||
|
||
#[test] | ||
fn test_submessage_without_package() { | ||
let _msg = M::default(); | ||
} |