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

remove responsebody indirection from response (#2201)

This commit is contained in:
Rob Ede
2021-05-09 20:12:48 +01:00
committed by GitHub
parent a9dc1586a0
commit 900c9e270e
31 changed files with 381 additions and 263 deletions

View File

@ -18,12 +18,6 @@ use crate::{body::Body, helpers::Writer, Response, ResponseBuilder};
pub use http::Error as HttpError;
/// A specialized [`std::result::Result`] for Actix Web operations.
///
/// This typedef is generally used to avoid writing out `actix_http::error::Error` directly and is
/// otherwise a direct mapping to `Result`.
pub type Result<T, E = Error> = std::result::Result<T, E>;
/// General purpose actix web error.
///
/// An actix web error is used to carry errors from `std::error`
@ -470,9 +464,8 @@ impl ResponseError for ContentTypeError {
///
/// ```
/// # use std::io;
/// # use actix_http::*;
///
/// fn index(req: Request) -> Result<&'static str> {
/// # use actix_http::{error, Request};
/// fn index(req: Request) -> Result<&'static str, actix_http::Error> {
/// Err(error::ErrorBadRequest(io::Error::new(io::ErrorKind::Other, "error")))
/// }
/// ```