diff --git a/actix-service/src/fn_service.rs b/actix-service/src/fn_service.rs index ad82c9c9..693d7f48 100644 --- a/actix-service/src/fn_service.rs +++ b/actix-service/src/fn_service.rs @@ -152,6 +152,17 @@ where } } +impl + IntoServiceFactory> for F +where + F: Fn(Req) -> Fut + Clone, + Fut: Future>, +{ + fn into_factory(self) -> FnServiceFactory { + FnServiceFactory::new(self) + } +} + /// Convert `Fn(&Config) -> Future` fn to NewService pub struct FnServiceConfig where