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:
parent
1a871d708e
commit
7596d0b7cb
@ -39,7 +39,7 @@ pub trait Guard {
|
|||||||
fn check(&self, request: &RequestHead) -> bool;
|
fn check(&self, request: &RequestHead) -> bool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return guard that matches if all of the supplied guards.
|
/// Create guard object for supplied function.
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use actix_web::{guard, web, App, HttpResponse};
|
/// use actix_web::{guard, web, App, HttpResponse};
|
||||||
@ -48,7 +48,9 @@ pub trait Guard {
|
|||||||
/// App::new().service(web::resource("/index.html").route(
|
/// App::new().service(web::resource("/index.html").route(
|
||||||
/// web::route()
|
/// web::route()
|
||||||
/// .guard(
|
/// .guard(
|
||||||
/// guard::fn_guard(|req| req.headers().contains_key("content-type")))
|
/// guard::fn_guard(
|
||||||
|
/// |req| req.headers()
|
||||||
|
/// .contains_key("content-type")))
|
||||||
/// .to(|| HttpResponse::MethodNotAllowed()))
|
/// .to(|| HttpResponse::MethodNotAllowed()))
|
||||||
/// );
|
/// );
|
||||||
/// }
|
/// }
|
||||||
|
Loading…
Reference in New Issue
Block a user