Skip to content

Commit

Permalink
fix(build): Allow empty packages (#382)
Browse files Browse the repository at this point in the history
Fixes #381
  • Loading branch information
tylerhawkes authored Jun 29, 2020
1 parent 327b4ff commit f085aba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion tonic-build/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ fn generate_methods<T: Service>(service: &T, proto_path: &str) -> TokenStream {

for method in service.methods() {
let path = format!(
"/{}.{}/{}",
"/{}{}{}/{}",
service.package(),
if service.package().is_empty() {
""
} else {
"."
},
service.identifier(),
method.identifier()
);
Expand Down
7 changes: 6 additions & 1 deletion tonic-build/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,13 @@ fn generate_methods<T: Service>(service: &T, proto_path: &str) -> TokenStream {

for method in service.methods() {
let path = format!(
"/{}.{}/{}",
"/{}{}{}/{}",
service.package(),
if service.package().is_empty() {
""
} else {
"."
},
service.identifier(),
method.identifier()
);
Expand Down

0 comments on commit f085aba

Please sign in to comment.