1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 05:10:36 +02:00

migrate to tokio 0.2.2

This commit is contained in:
Nikolay Kim
2019-12-05 16:40:24 +06:00
parent d49aca9595
commit 3a858feaec
37 changed files with 281 additions and 461 deletions

View File

@ -1,5 +1,9 @@
# Changes
## [1.0.0-alpha.3] - 2019-12-xx
* Migrate to `tokio=0.2.2`
## [1.0.0-alpha.2] - 2019-12-02
* Re-export `test` attribute macros

View File

@ -1,6 +1,6 @@
[package]
name = "actix-testing"
version = "1.0.0-alpha.2"
version = "1.0.0-alpha.3"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "Actix testing utils"
keywords = ["network", "framework", "async", "futures"]
@ -17,13 +17,11 @@ name = "actix_testing"
path = "src/lib.rs"
[dependencies]
actix-rt = "1.0.0-alpha.2"
actix-rt = "1.0.0-alpha.3"
actix-macros = "0.1.0-alpha.1"
actix-server = "1.0.0-alpha.2"
actix-server = "1.0.0-alpha.3"
actix-service = "1.0.0-alpha.3"
log = "0.4"
net2 = "0.2"
futures = "0.3.1"
tokio-net = { version = "=0.2.0-alpha.6" }

View File

@ -7,9 +7,7 @@ use std::{net, thread};
use actix_rt::{net::TcpStream, System};
use actix_server::{Server, ServerBuilder, ServiceFactory};
use net2::TcpBuilder;
use tokio_net::driver::Handle;
#[cfg(not(test))] // Work around for rust-lang/rust#62127
pub use actix_macros::test;
@ -25,7 +23,8 @@ pub use actix_macros::test;
/// use actix_service::{service_fn};
/// use actix_testing::TestServer;
///
/// fn main() {
/// #[actix_rt::main]
/// async fn main() {
/// let srv = TestServer::with(|| service_fn(
/// |sock| async move {
/// println!("New connection: {:?}", sock);
@ -142,7 +141,7 @@ impl TestServerRuntime {
/// Connect to server, return tokio TcpStream
pub fn connect(&self) -> std::io::Result<TcpStream> {
TcpStream::from_std(net::TcpStream::connect(self.addr)?, &Handle::default())
TcpStream::from_std(net::TcpStream::connect(self.addr)?)
}
}