fix(build): Allow creating multiple services in the same package (#173)
BREAKING CHANGE: Build will now generate each service client and server into their own modules.
This commit is contained in:
+2
-14
@@ -251,13 +251,7 @@ impl prost_build::ServiceGenerator for ServiceGenerator {
|
||||
let clients = &self.clients;
|
||||
|
||||
let client_service = quote::quote! {
|
||||
/// Generated client implementations.
|
||||
pub mod client {
|
||||
#![allow(unused_variables, dead_code, missing_docs)]
|
||||
use tonic::codegen::*;
|
||||
|
||||
#clients
|
||||
}
|
||||
#clients
|
||||
};
|
||||
|
||||
let code = format!("{}", client_service);
|
||||
@@ -270,13 +264,7 @@ impl prost_build::ServiceGenerator for ServiceGenerator {
|
||||
let servers = &self.servers;
|
||||
|
||||
let server_service = quote::quote! {
|
||||
/// Generated server implementations.
|
||||
pub mod server {
|
||||
#![allow(unused_variables, dead_code, missing_docs)]
|
||||
use tonic::codegen::*;
|
||||
|
||||
#servers
|
||||
}
|
||||
#servers
|
||||
};
|
||||
|
||||
let code = format!("{}", server_service);
|
||||
|
||||
Reference in New Issue
Block a user