Skip to content

Commit 2969071

Browse files
move MakeConnection re-export to codegen to clean up imports in generated code
1 parent 6f478b0 commit 2969071

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

tonic-build/src/client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn generate_connect(service_ident: &syn::Ident) -> TokenStream {
6767
/// connector.
6868
pub async fn connect_with_connector<C, D>(dst: D, connector: C) -> Result<Self, tonic::transport::Error>
6969
where
70-
C: tonic::transport::MakeConnection<http::Uri> + Send + 'static,
70+
C: MakeConnection<http::Uri> + Send + 'static,
7171
C::Connection: Unpin + Send + 'static,
7272
C::Future: Send + 'static,
7373
C::Error: Into<Box<dyn std::error::Error + Send + Sync>> + Send,

tonic/src/codegen.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ pub use std::future::Future;
99
pub use std::pin::Pin;
1010
pub use std::sync::Arc;
1111
pub use std::task::{Context, Poll};
12+
#[cfg(feature = "transport")]
13+
pub use tower_make::MakeConnection;
1214
pub use tower_service::Service;
1315
pub type StdError = Box<dyn std::error::Error + Send + Sync + 'static>;
1416
pub use crate::body::Body;

tonic/src/transport/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ pub use self::error::Error;
107107
pub use self::server::{Server, ServiceName};
108108
pub use self::tls::{Certificate, Identity};
109109
pub use hyper::Body;
110-
pub use tower_make::MakeConnection;
111110

112111
#[cfg(feature = "tls")]
113112
pub use self::endpoint::ClientTlsConfig;

0 commit comments

Comments
 (0)