Skip to content

Commit

Permalink
fix(codegen): Use stream type from codegen mod (#1446)
Browse files Browse the repository at this point in the history
* fix(codegen): Use stream type from codegen mod

* Add generated code
  • Loading branch information
LucioFranco authored Aug 2, 2023
1 parent 6077896 commit 60d776b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tonic-build/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ fn generate_trait_methods<T: Service>(

quote! {
#stream_doc
type #stream: tokio_stream::Stream<Item = std::result::Result<#res_message, tonic::Status>> + Send + 'static;
type #stream: tonic::codegen::tokio_stream::Stream<Item = std::result::Result<#res_message, tonic::Status>> + Send + 'static;

#method_doc
async fn #name(#self_param, request: tonic::Request<#req_message>)
Expand All @@ -329,7 +329,7 @@ fn generate_trait_methods<T: Service>(

quote! {
#stream_doc
type #stream: tokio_stream::Stream<Item = std::result::Result<#res_message, tonic::Status>> + Send + 'static;
type #stream: tonic::codegen::tokio_stream::Stream<Item = std::result::Result<#res_message, tonic::Status>> + Send + 'static;

#method_doc
async fn #name(#self_param, request: tonic::Request<tonic::Streaming<#req_message>>)
Expand Down
2 changes: 1 addition & 1 deletion tonic-health/src/generated/grpc.health.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ pub mod health_server {
tonic::Status,
>;
/// Server streaming response type for the Watch method.
type WatchStream: tokio_stream::Stream<
type WatchStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::HealthCheckResponse, tonic::Status>,
>
+ Send
Expand Down
2 changes: 1 addition & 1 deletion tonic-reflection/src/generated/grpc.reflection.v1alpha.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ pub mod server_reflection_server {
#[async_trait]
pub trait ServerReflection: Send + Sync + 'static {
/// Server streaming response type for the ServerReflectionInfo method.
type ServerReflectionInfoStream: tokio_stream::Stream<
type ServerReflectionInfoStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::ServerReflectionResponse,
tonic::Status,
Expand Down

0 comments on commit 60d776b

Please sign in to comment.