mirror of
https://github.com/actix/actix-web.git
synced 2025-01-04 22:38:44 +00:00
fix fn_guard doc string
This commit is contained in:
parent
1a871d708e
commit
7596d0b7cb
1 changed files with 4 additions and 2 deletions
|
@ -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 a new issue