tweak example docs

This commit is contained in:
Rob Ede 2020-10-20 23:53:47 +01:00
parent 32b4184530
commit aa726ba8d9
No known key found for this signature in database
GPG Key ID: C2A3B36E841A91E6
1 changed files with 2 additions and 2 deletions

View File

@ -34,9 +34,9 @@ use crate::{dev::Payload, FromRequest, HttpRequest};
/// 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
/// if let Some(flag) = opt_flag {
/// // using an optional extractor since the middleware may
/// // not be guaranteed to add our flag to request data
/// assert_eq!(&flag.into_inner(), req.extensions().get::<FlagFromMiddleware>().unwrap());
/// }
///