1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-24 08:22:59 +01:00

fix fn_guard doc string

This commit is contained in:
Nikolay Kim 2019-03-30 20:48:00 -07:00
parent 1a871d708e
commit 7596d0b7cb

View File

@ -39,7 +39,7 @@ pub trait Guard {
fn check(&self, request: &RequestHead) -> bool;
}
/// Return guard that matches if all of the supplied guards.
/// Create guard object for supplied function.
///
/// ```rust
/// use actix_web::{guard, web, App, HttpResponse};
@ -48,7 +48,9 @@ pub trait Guard {
/// App::new().service(web::resource("/index.html").route(
/// web::route()
/// .guard(
/// guard::fn_guard(|req| req.headers().contains_key("content-type")))
/// guard::fn_guard(
/// |req| req.headers()
/// .contains_key("content-type")))
/// .to(|| HttpResponse::MethodNotAllowed()))
/// );
/// }