Skip to content

Commit c2b22bc

Browse files
committed
refactor: cleanup in AsyncWrite in h1
1 parent 71f4c9a commit c2b22bc

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/h1/tcp.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ impl AsyncWrite for TcpConnWrapper {
4343
cx: &mut Context<'_>,
4444
buf: &[u8],
4545
) -> Poll<std::io::Result<usize>> {
46-
let amt = futures::ready!(Pin::new(&mut *self.conn).poll_write(cx, buf))?;
47-
Poll::Ready(Ok(amt))
46+
Pin::new(&mut *self.conn).poll_write(cx, buf)
4847
}
4948

5049
fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {

src/h1/tls.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ impl AsyncWrite for TlsConnWrapper {
5151
cx: &mut Context<'_>,
5252
buf: &[u8],
5353
) -> Poll<std::io::Result<usize>> {
54-
let amt = futures::ready!(Pin::new(&mut *self.conn).poll_write(cx, buf))?;
55-
Poll::Ready(Ok(amt))
54+
Pin::new(&mut *self.conn).poll_write(cx, buf)
5655
}
5756

5857
fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {
@@ -67,7 +66,6 @@ impl AsyncWrite for TlsConnWrapper {
6766
#[async_trait]
6867
impl Manager<TlsStream<TcpStream>, Error> for TlsConnection {
6968
async fn create(&self) -> Result<TlsStream<TcpStream>, Error> {
70-
log::trace!("Creating new socket to {:?}", self.addr);
7169
let raw_stream = async_std::net::TcpStream::connect(self.addr).await?;
7270
let tls_stream = add_tls(&self.host, raw_stream).await?;
7371
Ok(tls_stream)

0 commit comments

Comments
 (0)