1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-10-03 16:51:58 +00: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
/// 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
F: FnOnce(Resource<P>) -> R,
R: IntoNewService<U, ServiceRequest<P>>,
U: NewService<ServiceRequest<P>, Response = ServiceResponse, Error = ()>
+ 'static,
F: FnOnce(Resource<P>) -> Resource<P, U>,
U: NewService<
ServiceRequest<P>,
Response = ServiceResponse,
Error = (),
InitError = (),
> + 'static,
{
// create and configure default resource
self.default = Some(Rc::new(boxed::new_service(