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

This commit is contained in:
Lucio Franco
2022-02-22 15:33:29 -05:00
committed by GitHub
parent ee6e726707
commit a197c20469
2 changed files with 3 additions and 4 deletions
+1 -2
View File
@@ -185,8 +185,7 @@ async fn status_from_server_stream_with_source() {
.unwrap() .unwrap()
.connect_with_connector_lazy(tower::service_fn(move |_: Uri| async move { .connect_with_connector_lazy(tower::service_fn(move |_: Uri| async move {
Err::<MockStream, _>(std::io::Error::new(std::io::ErrorKind::Other, "WTF")) Err::<MockStream, _>(std::io::Error::new(std::io::ErrorKind::Other, "WTF"))
})) }));
.unwrap();
let mut client = test_stream_client::TestStreamClient::new(channel); let mut client = test_stream_client::TestStreamClient::new(channel);
+2 -2
View File
@@ -346,7 +346,7 @@ impl Endpoint {
/// ///
/// See the `uds` example for an example on how to use this function to build channel that /// See the `uds` example for an example on how to use this function to build channel that
/// uses a Unix socket transport. /// 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 where
C: MakeConnection<Uri> + Send + 'static, C: MakeConnection<Uri> + Send + 'static,
C::Connection: Unpin + Send + 'static, C::Connection: Unpin + Send + 'static,
@@ -359,7 +359,7 @@ impl Endpoint {
#[cfg(not(feature = "tls"))] #[cfg(not(feature = "tls"))]
let connector = service::connector(connector); let connector = service::connector(connector);
Ok(Channel::new(connector, self.clone())) Channel::new(connector, self.clone())
} }
/// Get the endpoint uri. /// Get the endpoint uri.