mirror of
https://github.com/fafhrd91/actix-web
synced 2025-02-25 13:22:50 +01:00
fix doc test
This commit is contained in:
parent
d7a1b434cb
commit
4d9dd30c72
@ -33,10 +33,9 @@ use crate::{dev::Payload, error::ErrorInternalServerError, Error, FromRequest, H
|
|||||||
/// req: HttpRequest,
|
/// req: HttpRequest,
|
||||||
/// opt_flag: Option<web::ReqData<FlagFromMiddleware>>,
|
/// opt_flag: Option<web::ReqData<FlagFromMiddleware>>,
|
||||||
/// ) -> impl Responder {
|
/// ) -> impl Responder {
|
||||||
/// // use an optional extractor if the middleware is
|
/// // use an option extractor if middleware is not guaranteed to add this type of req data
|
||||||
/// // not guaranteed to add this type of requests data
|
|
||||||
/// if let Some(flag) = opt_flag {
|
/// if let Some(flag) = opt_flag {
|
||||||
/// assert_eq!(&flag.into_inner(), req.extensions().get::<FlagFromMiddleware>().unwrap());
|
/// assert_eq!(&flag.into_inner(), req.req_data().get::<FlagFromMiddleware>().unwrap());
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// HttpResponse::Ok()
|
/// HttpResponse::Ok()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user