From 00654aadc55a5000acea84a0d15c752ec2f77bde Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 30 Oct 2022 20:25:10 +0000 Subject: [PATCH] use direct tokio exports where possible --- .cargo/config.toml | 2 +- actix-codec/src/lib.rs | 5 ++--- actix-server/Cargo.toml | 4 ++-- actix-tls/Cargo.toml | 12 ++++++------ actix-tls/src/accept/native_tls.rs | 2 +- actix-tls/src/accept/openssl.rs | 2 +- actix-tls/src/accept/rustls.rs | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 4024bc0e..c4f6e3f6 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -20,4 +20,4 @@ ci-test = "hack --feature-powerset --exclude-features=io-uring test --lib --test ci-test-win = "hack --feature-powerset --depth 2 --exclude-features=io-uring test --lib --tests --no-fail-fast -- --nocapture" # test with io-uring feature -ci-test-linux = " hack --feature-powerset test --lib --tests --no-fail-fast -- --nocapture" +ci-test-linux = "hack --feature-powerset test --lib --tests --no-fail-fast -- --nocapture" diff --git a/actix-codec/src/lib.rs b/actix-codec/src/lib.rs index db1f90de..020e40e2 100644 --- a/actix-codec/src/lib.rs +++ b/actix-codec/src/lib.rs @@ -1,8 +1,7 @@ //! Codec utilities for working with framed protocols. //! -//! Contains adapters to go from streams of bytes, [`AsyncRead`] and -//! [`AsyncWrite`], to framed streams implementing [`Sink`] and [`Stream`]. -//! Framed streams are also known as `transports`. +//! Contains adapters to go from streams of bytes, [`AsyncRead`] and [`AsyncWrite`], to framed +//! streams implementing [`Sink`] and [`Stream`]. Framed streams are also known as `transports`. //! //! [`Sink`]: futures_sink::Sink //! [`Stream`]: futures_core::Stream diff --git a/actix-server/Cargo.toml b/actix-server/Cargo.toml index 3f2dcad0..eb2152a3 100755 --- a/actix-server/Cargo.toml +++ b/actix-server/Cargo.toml @@ -40,8 +40,8 @@ tracing = { version = "0.1.30", default-features = false, features = ["log"] } tokio-uring = { version = "0.3", optional = true } [dev-dependencies] -actix-codec = "0.5.0" -actix-rt = "2.6.0" +actix-codec = "0.5" +actix-rt = "2.6" bytes = "1" env_logger = "0.9" diff --git a/actix-tls/Cargo.toml b/actix-tls/Cargo.toml index a2313688..56591f35 100755 --- a/actix-tls/Cargo.toml +++ b/actix-tls/Cargo.toml @@ -30,19 +30,18 @@ accept = [] connect = [] # use openssl impls -openssl = ["tls-openssl", "tokio-openssl", "actix-codec"] +openssl = ["tls-openssl", "tokio-openssl"] # use rustls impls -rustls = ["tokio-rustls", "webpki-roots", "actix-codec"] +rustls = ["tokio-rustls", "webpki-roots"] # use native-tls impls -native-tls = ["tokio-native-tls", "actix-codec"] +native-tls = ["tokio-native-tls"] # support http::Uri as connect address uri = ["http"] [dependencies] -actix-codec = { version = "0.5.0", optional = true } actix-rt = { version = "2.2.0", default-features = false } actix-service = "2" actix-utils = "3" @@ -50,6 +49,7 @@ actix-utils = "3" futures-core = { version = "0.3.7", default-features = false, features = ["alloc"] } impl-more = "0.1" pin-project-lite = "0.2.7" +tokio = "1.13.1" tokio-util = "0.7" tracing = { version = "0.1.30", default-features = false, features = ["log"] } @@ -68,8 +68,8 @@ webpki-roots = { version = "0.22", optional = true } tokio-native-tls = { version = "0.3", optional = true } [dev-dependencies] -actix-codec = "0.5.0" -actix-rt = "2.2.0" +actix-codec = "0.5" +actix-rt = "2.2" actix-server = "2" bytes = "1" env_logger = "0.9" diff --git a/actix-tls/src/accept/native_tls.rs b/actix-tls/src/accept/native_tls.rs index f9dda144..ce98e687 100644 --- a/actix-tls/src/accept/native_tls.rs +++ b/actix-tls/src/accept/native_tls.rs @@ -10,7 +10,6 @@ use std::{ time::Duration, }; -use actix_codec::{AsyncRead, AsyncWrite, ReadBuf}; use actix_rt::{ net::{ActixStream, Ready}, time::timeout, @@ -21,6 +20,7 @@ use actix_utils::{ future::{ready, Ready as FutReady}, }; use futures_core::future::LocalBoxFuture; +use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use tokio_native_tls::{native_tls::Error, TlsAcceptor}; use super::{TlsError, DEFAULT_TLS_HANDSHAKE_TIMEOUT, MAX_CONN_COUNTER}; diff --git a/actix-tls/src/accept/openssl.rs b/actix-tls/src/accept/openssl.rs index 1f068274..32973b66 100644 --- a/actix-tls/src/accept/openssl.rs +++ b/actix-tls/src/accept/openssl.rs @@ -11,7 +11,6 @@ use std::{ time::Duration, }; -use actix_codec::{AsyncRead, AsyncWrite, ReadBuf}; use actix_rt::{ net::{ActixStream, Ready}, time::{sleep, Sleep}, @@ -23,6 +22,7 @@ use actix_utils::{ }; use openssl::ssl::{Error, Ssl, SslAcceptor}; use pin_project_lite::pin_project; +use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use super::{TlsError, DEFAULT_TLS_HANDSHAKE_TIMEOUT, MAX_CONN_COUNTER}; diff --git a/actix-tls/src/accept/rustls.rs b/actix-tls/src/accept/rustls.rs index 73e77bd5..fd0ebfb0 100644 --- a/actix-tls/src/accept/rustls.rs +++ b/actix-tls/src/accept/rustls.rs @@ -12,7 +12,6 @@ use std::{ time::Duration, }; -use actix_codec::{AsyncRead, AsyncWrite, ReadBuf}; use actix_rt::{ net::{ActixStream, Ready}, time::{sleep, Sleep}, @@ -23,6 +22,7 @@ use actix_utils::{ future::{ready, Ready as FutReady}, }; use pin_project_lite::pin_project; +use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use tokio_rustls::rustls::ServerConfig; use tokio_rustls::{Accept, TlsAcceptor};