From 2e18ca805c628936b4a782dcb7e7065985f452ba Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 4 Mar 2019 20:40:38 -0800 Subject: [PATCH] use IntoFuture --- actix-server/CHANGES.md | 2 +- actix-server/Cargo.toml | 4 ++-- actix-server/src/config.rs | 16 +++++++++++----- actix-server/src/services.rs | 3 ++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/actix-server/CHANGES.md b/actix-server/CHANGES.md index 0183271d..52a62efe 100644 --- a/actix-server/CHANGES.md +++ b/actix-server/CHANGES.md @@ -1,6 +1,6 @@ # Changes -## [0.3.1] - 2019-03-xx +## [0.3.1] - 2019-03-04 ### Added diff --git a/actix-server/Cargo.toml b/actix-server/Cargo.toml index 0475ee7b..4009a14d 100644 --- a/actix-server/Cargo.toml +++ b/actix-server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-server" -version = "0.3.0" +version = "0.3.1" authors = ["Nikolay Kim "] description = "Actix server - General purpose tcp server" keywords = ["network", "framework", "async", "futures"] @@ -33,7 +33,7 @@ ssl = ["openssl", "tokio-openssl"] rust-tls = ["rustls", "tokio-rustls", "webpki", "webpki-roots"] [dependencies] -actix-service = "0.3.0" +actix-service = "0.3.2" actix-rt = "0.1.0" log = "0.4" diff --git a/actix-server/src/config.rs b/actix-server/src/config.rs index 885f4254..fa51c4d1 100644 --- a/actix-server/src/config.rs +++ b/actix-server/src/config.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::{fmt, io, net}; use actix_service::{IntoNewService, NewService}; -use futures::future::{join_all, Future}; +use futures::future::{join_all, Future, IntoFuture}; use log::error; use tokio_tcp::TcpStream; @@ -220,9 +220,15 @@ where type Future = Box>; fn new_service(&self, _: &()) -> Self::Future { - Box::new(self.inner.new_service(&()).map_err(|_| ()).map(|s| { - let service: BoxedServerService = Box::new(StreamService::new(s)); - service - })) + Box::new( + self.inner + .new_service(&()) + .into_future() + .map_err(|_| ()) + .map(|s| { + let service: BoxedServerService = Box::new(StreamService::new(s)); + service + }), + ) } } diff --git a/actix-server/src/services.rs b/actix-server/src/services.rs index 2aaf998d..a986d330 100644 --- a/actix-server/src/services.rs +++ b/actix-server/src/services.rs @@ -3,7 +3,7 @@ use std::time::Duration; use actix_rt::spawn; use actix_service::{NewService, Service}; -use futures::future::{err, ok, FutureResult}; +use futures::future::{err, ok, FutureResult, IntoFuture}; use futures::{Future, Poll}; use log::error; use tokio_reactor::Handle; @@ -129,6 +129,7 @@ where self.inner .create() .new_service(&()) + .into_future() .map_err(|_| ()) .map(move |inner| { let service: BoxedServerService = Box::new(StreamService::new(inner));