From a6f479a6fae0e3b0161292ce396ecb04d6740b5b Mon Sep 17 00:00:00 2001 From: Luca P Date: Fri, 28 Jan 2022 09:55:30 +0000 Subject: [PATCH] Update documentation for App::default_service to match reality. --- src/app.rs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/app.rs b/src/app.rs index da33ebc4b..2a85c2396 100644 --- a/src/app.rs +++ b/src/app.rs @@ -236,10 +236,10 @@ where self } - /// Default service to be used if no matching resource could be found. - /// - /// It is possible to use services like `Resource`, `Route`. + /// Default service that is invoked when no matching resource could be found. /// + /// You must use a [`Route`] as default service: + /// /// ``` /// use actix_web::{web, App, HttpResponse}; /// @@ -253,19 +253,6 @@ where /// .default_service( /// web::route().to(|| HttpResponse::NotFound())); /// ``` - /// - /// It is also possible to use static files as default service. - /// - /// ``` - /// use actix_web::{web, App, HttpResponse}; - /// - /// let app = App::new() - /// .service( - /// web::resource("/index.html").to(|| HttpResponse::Ok())) - /// .default_service( - /// web::to(|| HttpResponse::NotFound()) - /// ); - /// ``` pub fn default_service(mut self, svc: F) -> Self where F: IntoServiceFactory,