fix(build): Allow Services to be named Result (#1203)

closes #1156
This commit is contained in:
Shrutesh Pachineela
2022-12-21 12:07:07 -05:00
committed by GitHub
parent a72cf04b44
commit a562a3ce32
10 changed files with 86 additions and 21 deletions
+4 -4
View File
@@ -225,7 +225,7 @@ fn generate_unary<T: Method>(
pub async fn #ident(
&mut self,
request: impl tonic::IntoRequest<#request>,
) -> Result<tonic::Response<#response>, tonic::Status> {
) -> std::result::Result<tonic::Response<#response>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into()))
})?;
@@ -251,7 +251,7 @@ fn generate_server_streaming<T: Method>(
pub async fn #ident(
&mut self,
request: impl tonic::IntoRequest<#request>,
) -> Result<tonic::Response<tonic::codec::Streaming<#response>>, tonic::Status> {
) -> std::result::Result<tonic::Response<tonic::codec::Streaming<#response>>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into()))
})?;
@@ -277,7 +277,7 @@ fn generate_client_streaming<T: Method>(
pub async fn #ident(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = #request>
) -> Result<tonic::Response<#response>, tonic::Status> {
) -> std::result::Result<tonic::Response<#response>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into()))
})?;
@@ -303,7 +303,7 @@ fn generate_streaming<T: Method>(
pub async fn #ident(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = #request>
) -> Result<tonic::Response<tonic::codec::Streaming<#response>>, tonic::Status> {
) -> std::result::Result<tonic::Response<tonic::codec::Streaming<#response>>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(tonic::Code::Unknown, format!("Service was not ready: {}", e.into()))
})?;