Skip to content

Commit

Permalink
chore(server): Remove unnecessary Connected trait bound (#1796)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Jul 13, 2024
1 parent 90356f6 commit 819c390
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tonic/src/transport/server/incoming.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::service::ServerIo;
#[cfg(feature = "tls")]
use super::service::TlsAcceptor;
use super::{service::ServerIo, Connected};
use std::{
net::{SocketAddr, TcpListener as StdTcpListener},
pin::{pin, Pin},
Expand All @@ -20,7 +20,7 @@ pub(crate) fn tcp_incoming<IO, IE>(
incoming: impl Stream<Item = Result<IO, IE>>,
) -> impl Stream<Item = Result<ServerIo<IO>, crate::Error>>
where
IO: AsyncRead + AsyncWrite + Connected + Unpin + Send + 'static,
IO: AsyncRead + AsyncWrite + Unpin + Send + 'static,
IE: Into<crate::Error>,
{
async_stream::try_stream! {
Expand All @@ -38,7 +38,7 @@ pub(crate) fn tcp_incoming<IO, IE>(
tls: Option<TlsAcceptor>,
) -> impl Stream<Item = Result<ServerIo<IO>, crate::Error>>
where
IO: AsyncRead + AsyncWrite + Connected + Unpin + Send + 'static,
IO: AsyncRead + AsyncWrite + Unpin + Send + 'static,
IE: Into<crate::Error>,
{
async_stream::try_stream! {
Expand Down
3 changes: 1 addition & 2 deletions tonic/src/transport/server/service/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use tokio_rustls::{
};

use crate::transport::{
server::Connected,
service::tls::{add_certs_from_pem, load_identity, ALPN_H2},
Certificate, Identity,
};
Expand Down Expand Up @@ -52,7 +51,7 @@ impl TlsAcceptor {

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

0 comments on commit 819c390

Please sign in to comment.