From 2c1d0f75c0e432fcb3123c09cfd374ad390a8ebe Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Mon, 24 Feb 2025 00:00:00 +0000 Subject: [PATCH] chore(tls): remove redundant i/o bounds this commit removes a redundant set of trait bounds from `linkerd_tls::Client`'s `tower::Service` implementation. this client type is generic over a `C`-typed `MakeConnection`. this trait is effectively an alias for particular services, and already by definition is prerequisite upon `Connection` responses that are an asynchronous reader/writer. see the definition of the trait, here: ```rust // linkerd/stack/src/connect.rs pub trait MakeConnection { /// An I/O type that represents a connection to the remote endpoint. type Connection: AsyncRead + AsyncWrite; /// Metadata associated with the established connection. type Metadata; type Error: Into; type Future: Future>; /// Determines whether the connector is ready to establish a connection. fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll>; /// Establishes a connection. fn connect(&mut self, t: T) -> Self::Future; // contd... } ``` thus, we can remove these bounds from the tls client. the connection is already, by virtue of `C: MakeConnection`, an `AsyncRead + AsyncWrite` type. see https://github.com/linkerd/linkerd2/issues/8733. Signed-off-by: katelyn martin --- linkerd/tls/src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkerd/tls/src/client.rs b/linkerd/tls/src/client.rs index ca07551208..642db8a618 100644 --- a/linkerd/tls/src/client.rs +++ b/linkerd/tls/src/client.rs @@ -102,7 +102,7 @@ where T: Param, L: NewService, C: MakeConnection, - C::Connection: io::AsyncRead + io::AsyncWrite + Send + Unpin, + C::Connection: Send + Unpin, C::Metadata: Send + Unpin, C::Future: Send + 'static, H: Service), Error = io::Error>