Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(transport): connect w/ connector infailable #922

Merged
merged 1 commit into from Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions tests/integration_tests/tests/status.rs
Expand Up @@ -185,8 +185,7 @@ async fn status_from_server_stream_with_source() {
.unwrap()
.connect_with_connector_lazy(tower::service_fn(move |_: Uri| async move {
Err::<MockStream, _>(std::io::Error::new(std::io::ErrorKind::Other, "WTF"))
}))
.unwrap();
}));

let mut client = test_stream_client::TestStreamClient::new(channel);

Expand Down
4 changes: 2 additions & 2 deletions tonic/src/transport/channel/endpoint.rs
Expand Up @@ -346,7 +346,7 @@ impl Endpoint {
///
/// See the `uds` example for an example on how to use this function to build channel that
/// uses a Unix socket transport.
pub fn connect_with_connector_lazy<C>(&self, connector: C) -> Result<Channel, Error>
pub fn connect_with_connector_lazy<C>(&self, connector: C) -> Channel
where
C: MakeConnection<Uri> + Send + 'static,
C::Connection: Unpin + Send + 'static,
Expand All @@ -359,7 +359,7 @@ impl Endpoint {
#[cfg(not(feature = "tls"))]
let connector = service::connector(connector);

Ok(Channel::new(connector, self.clone()))
Channel::new(connector, self.clone())
}

/// Get the endpoint uri.
Expand Down