1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-17 05:36:36 +00:00

fix doc test

This commit is contained in:
Rob Ede 2021-12-07 21:50:20 +00:00
parent d7a1b434cb
commit 4d9dd30c72
No known key found for this signature in database
GPG key ID: 97C636207D3EF933

View file

@ -33,12 +33,11 @@ use crate::{dev::Payload, error::ErrorInternalServerError, Error, FromRequest, H
/// req: HttpRequest,
/// opt_flag: Option<web::ReqData<FlagFromMiddleware>>,
/// ) -> impl Responder {
/// // use an optional extractor if the middleware is
/// // not guaranteed to add this type of requests data
/// // use an option extractor if middleware is not guaranteed to add this type of req data
/// 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()
/// }
/// ```