From 4109f663b1f49a4c5913d800879a23249b3597ce Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Sun, 7 Feb 2021 20:01:27 -0800 Subject: [PATCH] clean up import --- actix-tls/src/accept/nativetls.rs | 15 ++++++++------- actix-tls/src/accept/openssl.rs | 2 +- actix-tls/src/accept/rustls.rs | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/actix-tls/src/accept/nativetls.rs b/actix-tls/src/accept/nativetls.rs index 0718b711..15e43c99 100644 --- a/actix-tls/src/accept/nativetls.rs +++ b/actix-tls/src/accept/nativetls.rs @@ -1,7 +1,11 @@ -use std::io; -use std::ops::{Deref, DerefMut}; -use std::task::{Context, Poll}; +use std::{ + io::{self, IoSlice}, + ops::{Deref, DerefMut}, + pin::Pin, + task::{Context, Poll}, +}; +use actix_codec::{AsyncRead, AsyncWrite, ReadBuf}; use actix_rt::net::ActixStream; use actix_service::{Service, ServiceFactory}; use actix_utils::counter::Counter; @@ -11,9 +15,6 @@ pub use tokio_native_tls::native_tls::Error; pub use tokio_native_tls::TlsAcceptor; use super::MAX_CONN_COUNTER; -use actix_codec::{AsyncRead, AsyncWrite, ReadBuf}; -use std::io::IoSlice; -use std::pin::Pin; /// wrapper type for `tokio_native_tls::TlsStream` in order to impl `ActixStream` trait. pub struct TlsStream(tokio_native_tls::TlsStream); @@ -83,7 +84,7 @@ impl ActixStream for TlsStream { T::poll_read_ready((&**self).get_ref().get_ref().get_ref(), cx) } - fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll> { + fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll> { T::poll_write_ready((&**self).get_ref().get_ref().get_ref(), cx) } } diff --git a/actix-tls/src/accept/openssl.rs b/actix-tls/src/accept/openssl.rs index 8c110ed5..b490888a 100644 --- a/actix-tls/src/accept/openssl.rs +++ b/actix-tls/src/accept/openssl.rs @@ -86,7 +86,7 @@ impl ActixStream for SslStream { T::poll_read_ready((&**self).get_ref(), cx) } - fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll> { + fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll> { T::poll_write_ready((&**self).get_ref(), cx) } } diff --git a/actix-tls/src/accept/rustls.rs b/actix-tls/src/accept/rustls.rs index 112952df..c19a6cec 100644 --- a/actix-tls/src/accept/rustls.rs +++ b/actix-tls/src/accept/rustls.rs @@ -86,7 +86,7 @@ impl ActixStream for TlsStream { T::poll_read_ready((&**self).get_ref().0, cx) } - fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll> { + fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll> { T::poll_write_ready((&**self).get_ref().0, cx) } }