From 017e40f73369d79e9beb3191d6fa8f7ac76c4b21 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sat, 23 Apr 2022 21:02:24 +0100 Subject: [PATCH] update optional extractor impl docs --- actix-web/src/extract.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/actix-web/src/extract.rs b/actix-web/src/extract.rs index 1b2f0bd1..7d187c90 100644 --- a/actix-web/src/extract.rs +++ b/actix-web/src/extract.rs @@ -80,9 +80,9 @@ pub trait FromRequest: Sized { } } -/// Optionally extract a field from the request +/// Optionally extract from the request. /// -/// If the FromRequest for T fails, return None rather than returning an error response +/// If the inner `T::from_request` returns an error, handler will receive `None` instead. /// /// # Examples /// ``` @@ -167,9 +167,10 @@ where } } -/// Optionally extract a field from the request or extract the Error if unsuccessful +/// Extract from the request, passing error type through to handler. /// -/// If the `FromRequest` for T fails, inject Err into handler rather than returning an error response +/// If the inner `T::from_request` returns an error, allow handler to receive the error rather than +/// immediately returning an error response. /// /// # Examples /// ```