1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-01-18 22:01:50 +01:00

tune App::default_resource signature

This commit is contained in:
Nikolay Kim 2019-03-05 19:30:44 -08:00
parent f71354783e
commit 0de47211b2

View File

@ -426,12 +426,15 @@ where
/// ///
/// Default resource works with resources only and does not work with /// Default resource works with resources only and does not work with
/// custom services. /// custom services.
pub fn default_resource<F, R, U>(mut self, f: F) -> Self pub fn default_resource<F, U>(mut self, f: F) -> Self
where where
F: FnOnce(Resource<P>) -> R, F: FnOnce(Resource<P>) -> Resource<P, U>,
R: IntoNewService<U, ServiceRequest<P>>, U: NewService<
U: NewService<ServiceRequest<P>, Response = ServiceResponse, Error = ()> ServiceRequest<P>,
+ 'static, Response = ServiceResponse,
Error = (),
InitError = (),
> + 'static,
{ {
// create and configure default resource // create and configure default resource
self.default = Some(Rc::new(boxed::new_service( self.default = Some(Rc::new(boxed::new_service(