From 316974616ac74bf431da34ca783564b2926e74c5 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 11 Jan 2019 21:39:58 -0800 Subject: [PATCH] Use FnMut instead of Fn for FnService --- actix-service/CHANGES.md | 7 +++++++ actix-service/Cargo.toml | 2 +- actix-service/src/fn_service.rs | 20 ++++++++++---------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/actix-service/CHANGES.md b/actix-service/CHANGES.md index 7817e6efde..9ca2326a0c 100644 --- a/actix-service/CHANGES.md +++ b/actix-service/CHANGES.md @@ -1,5 +1,12 @@ # Changes +## [0.1.4] - 2019-01-11 + +## Changed + +* Use `FnMut` instead of `Fn` for `FnService` + + ## [0.1.3] - 2018-12-12 ## Changed diff --git a/actix-service/Cargo.toml b/actix-service/Cargo.toml index 49a2ae1ac4..6a5109a986 100644 --- a/actix-service/Cargo.toml +++ b/actix-service/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-service" -version = "0.1.3" +version = "0.1.4" authors = ["Nikolay Kim "] description = "Actix Service" keywords = ["network", "framework", "async", "futures"] diff --git a/actix-service/src/fn_service.rs b/actix-service/src/fn_service.rs index d6e19e8a47..0726ca7873 100644 --- a/actix-service/src/fn_service.rs +++ b/actix-service/src/fn_service.rs @@ -9,7 +9,7 @@ use super::{IntoNewService, IntoService, NewService, Service}; pub struct FnService where - F: Fn(Req) -> Fut, + F: FnMut(Req) -> Fut, Fut: IntoFuture, { f: F, @@ -18,7 +18,7 @@ where impl FnService where - F: Fn(Req) -> Fut, + F: FnMut(Req) -> Fut, Fut: IntoFuture, { pub fn new(f: F) -> Self { @@ -31,7 +31,7 @@ where impl Clone for FnService where - F: Fn(Req) -> Fut + Clone, + F: FnMut(Req) -> Fut + Clone, Fut: IntoFuture, { fn clone(&self) -> Self { @@ -44,7 +44,7 @@ where impl Service for FnService where - F: Fn(Req) -> Fut, + F: FnMut(Req) -> Fut, Fut: IntoFuture, { type Response = Resp; @@ -62,7 +62,7 @@ where impl IntoService, Req> for F where - F: Fn(Req) -> Fut + 'static, + F: FnMut(Req) -> Fut + 'static, Fut: IntoFuture, { fn into_service(self) -> FnService { @@ -72,7 +72,7 @@ where pub struct FnNewService where - F: Fn(Req) -> Fut, + F: FnMut(Req) -> Fut, Fut: IntoFuture, { f: F, @@ -81,7 +81,7 @@ where impl FnNewService where - F: Fn(Req) -> Fut + Clone, + F: FnMut(Req) -> Fut + Clone, Fut: IntoFuture, { pub fn new(f: F) -> Self { @@ -94,7 +94,7 @@ where impl NewService for FnNewService where - F: Fn(Req) -> Fut + Clone, + F: FnMut(Req) -> Fut + Clone, Fut: IntoFuture, { type Response = Resp; @@ -110,7 +110,7 @@ where impl IntoNewService, Req> for F where - F: Fn(Req) -> Fut + Clone + 'static, + F: FnMut(Req) -> Fut + Clone + 'static, Fut: IntoFuture, { fn into_new_service(self) -> FnNewService { @@ -120,7 +120,7 @@ where impl Clone for FnNewService where - F: Fn(Req) -> Fut + Clone, + F: FnMut(Req) -> Fut + Clone, Fut: IntoFuture, { fn clone(&self) -> Self {