Skip to content

Commit 819c390

Browse files
authored
chore(server): Remove unnecessary Connected trait bound (#1796)
1 parent 90356f6 commit 819c390

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tonic/src/transport/server/incoming.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use super::service::ServerIo;
12
#[cfg(feature = "tls")]
23
use super::service::TlsAcceptor;
3-
use super::{service::ServerIo, Connected};
44
use std::{
55
net::{SocketAddr, TcpListener as StdTcpListener},
66
pin::{pin, Pin},
@@ -20,7 +20,7 @@ pub(crate) fn tcp_incoming<IO, IE>(
2020
incoming: impl Stream<Item = Result<IO, IE>>,
2121
) -> impl Stream<Item = Result<ServerIo<IO>, crate::Error>>
2222
where
23-
IO: AsyncRead + AsyncWrite + Connected + Unpin + Send + 'static,
23+
IO: AsyncRead + AsyncWrite + Unpin + Send + 'static,
2424
IE: Into<crate::Error>,
2525
{
2626
async_stream::try_stream! {
@@ -38,7 +38,7 @@ pub(crate) fn tcp_incoming<IO, IE>(
3838
tls: Option<TlsAcceptor>,
3939
) -> impl Stream<Item = Result<ServerIo<IO>, crate::Error>>
4040
where
41-
IO: AsyncRead + AsyncWrite + Connected + Unpin + Send + 'static,
41+
IO: AsyncRead + AsyncWrite + Unpin + Send + 'static,
4242
IE: Into<crate::Error>,
4343
{
4444
async_stream::try_stream! {

tonic/src/transport/server/service/tls.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use tokio_rustls::{
88
};
99

1010
use crate::transport::{
11-
server::Connected,
1211
service::tls::{add_certs_from_pem, load_identity, ALPN_H2},
1312
Certificate, Identity,
1413
};
@@ -52,7 +51,7 @@ impl TlsAcceptor {
5251

5352
pub(crate) async fn accept<IO>(&self, io: IO) -> Result<TlsStream<IO>, crate::Error>
5453
where
55-
IO: AsyncRead + AsyncWrite + Connected + Unpin + Send + 'static,
54+
IO: AsyncRead + AsyncWrite + Unpin + Send + 'static,
5655
{
5756
let acceptor = RustlsAcceptor::from(self.inner.clone());
5857
acceptor.accept(io).await.map_err(Into::into)

0 commit comments

Comments
 (0)