1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 08:45:10 +02:00

Remove checked_expr (#2401)

This commit is contained in:
Omid Rad
2021-10-11 19:28:09 +02:00
committed by GitHub
parent a3806cde19
commit a6707fb7ee
2 changed files with 4 additions and 10 deletions

View File

@ -393,16 +393,6 @@ impl<B> ServiceResponse<B> {
self.response.headers_mut()
}
/// Execute closure and in case of error convert it to response.
pub fn checked_expr<F, E>(mut self, f: F) -> Result<Self, Error>
where
F: FnOnce(&mut Self) -> Result<(), E>,
E: Into<Error>,
{
f(&mut self).map_err(Into::into)?;
Ok(self)
}
/// Extract response body
pub fn into_body(self) -> B {
self.response.into_body()