Skip to content

Commit

Permalink
update optional extractor impl docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Apr 23, 2022
1 parent 45592b3 commit 017e40f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions actix-web/src/extract.rs
Expand Up @@ -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
/// ```
Expand Down Expand Up @@ -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
/// ```
Expand Down

0 comments on commit 017e40f

Please sign in to comment.