Skip to content

Commit 8e5d0fd

Browse files
authored
chore(tls): remove redundant i/o bounds (#3647)
this commit removes a redundant set of trait bounds from `linkerd_tls::Client<L, C>`'s `tower::Service<T>` 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<T> { /// 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<Error>; type Future: Future<Output = Result<(Self::Connection, Self::Metadata), Self::Error>>; /// Determines whether the connector is ready to establish a connection. fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>; /// 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 linkerd/linkerd2#8733. Signed-off-by: katelyn martin <[email protected]>
1 parent 78e6c7a commit 8e5d0fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

linkerd/tls/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ where
102102
T: Param<ConditionalClientTls>,
103103
L: NewService<ClientTls, Service = H>,
104104
C: MakeConnection<T, Error = io::Error>,
105-
C::Connection: io::AsyncRead + io::AsyncWrite + Send + Unpin,
105+
C::Connection: Send + Unpin,
106106
C::Metadata: Send + Unpin,
107107
C::Future: Send + 'static,
108108
H: Service<C::Connection, Response = (I, Option<NegotiatedProtocol>), Error = io::Error>

0 commit comments

Comments
 (0)