diff --git a/actix-http/src/response_builder.rs b/actix-http/src/response_builder.rs index 91777ca44..f11f89219 100644 --- a/actix-http/src/response_builder.rs +++ b/actix-http/src/response_builder.rs @@ -20,7 +20,7 @@ use crate::{ /// /// # Examples /// ``` -/// use actix_http::{Response, ResponseBuilder, body, http::StatusCode, http::header}; +/// use actix_http::{Response, ResponseBuilder, StatusCode, body, header}; /// /// # actix_rt::System::new().block_on(async { /// let mut res: Response<_> = Response::build(StatusCode::OK) @@ -47,9 +47,7 @@ impl ResponseBuilder { /// Create response builder /// /// # Examples - /// ``` - /// use actix_http::{Response, ResponseBuilder, http::StatusCode}; - /// + // /// use actix_http::{Response, ResponseBuilder, StatusCode};, / `` /// let res: Response<_> = ResponseBuilder::default().finish(); /// assert_eq!(res.status(), StatusCode::OK); /// ``` @@ -64,9 +62,7 @@ impl ResponseBuilder { /// Set HTTP status code of this response. /// /// # Examples - /// ``` - /// use actix_http::{ResponseBuilder, http::StatusCode}; - /// + // /// use actix_http::{ResponseBuilder, StatusCode};, / `` /// let res = ResponseBuilder::default().status(StatusCode::NOT_FOUND).finish(); /// assert_eq!(res.status(), StatusCode::NOT_FOUND); /// ``` @@ -82,7 +78,7 @@ impl ResponseBuilder { /// /// # Examples /// ``` - /// use actix_http::{ResponseBuilder, http::header}; + /// use actix_http::{ResponseBuilder, header}; /// /// let res = ResponseBuilder::default() /// .insert_header((header::CONTENT_TYPE, mime::APPLICATION_JSON)) @@ -112,7 +108,7 @@ impl ResponseBuilder { /// /// # Examples /// ``` - /// use actix_http::{ResponseBuilder, http::header}; + /// use actix_http::{ResponseBuilder, header}; /// /// let res = ResponseBuilder::default() /// .append_header((header::CONTENT_TYPE, mime::APPLICATION_JSON)) diff --git a/src/app.rs b/src/app.rs index e1db613b8..a27dd54a6 100644 --- a/src/app.rs +++ b/src/app.rs @@ -353,7 +353,7 @@ where /// ``` /// use actix_service::Service; /// use actix_web::{middleware, web, App}; - /// use actix_web::http::{header::CONTENT_TYPE, HeaderValue}; + /// use actix_web::http::header::{CONTENT_TYPE, HeaderValue}; /// /// async fn index() -> &'static str { /// "Welcome!" @@ -410,7 +410,7 @@ where /// ``` /// use actix_service::Service; /// use actix_web::{web, App}; - /// use actix_web::http::{header::CONTENT_TYPE, HeaderValue}; + /// use actix_web::http::header::{CONTENT_TYPE, HeaderValue}; /// /// async fn index() -> &'static str { /// "Welcome!" diff --git a/src/middleware/err_handlers.rs b/src/middleware/err_handlers.rs index 246482cc5..756da30c3 100644 --- a/src/middleware/err_handlers.rs +++ b/src/middleware/err_handlers.rs @@ -37,19 +37,20 @@ type ErrorHandler = dyn Fn(ServiceResponse) -> Result(mut res: dev::ServiceResponse) -> Result> { /// res.response_mut() /// .headers_mut() -/// .insert(http::header::CONTENT_TYPE, http::HeaderValue::from_static("Error")); +/// .insert(header::CONTENT_TYPE, header::HeaderValue::from_static("Error")); /// Ok(ErrorHandlerResponse::Response(res)) /// } /// /// let app = App::new() /// .wrap( /// ErrorHandlers::new() -/// .handler(http::StatusCode::INTERNAL_SERVER_ERROR, render_500), +/// .handler(StatusCode::INTERNAL_SERVER_ERROR, render_500), /// ) /// .service(web::resource("/test") /// .route(web::get().to(|| HttpResponse::Ok())) diff --git a/src/middleware/logger.rs b/src/middleware/logger.rs index 0cdad5a63..74daa26d5 100644 --- a/src/middleware/logger.rs +++ b/src/middleware/logger.rs @@ -126,7 +126,8 @@ impl Logger { /// /// # Example /// ``` - /// # use actix_web::{http::HeaderValue, middleware::Logger}; + /// # use actix_web::http::{header::HeaderValue}; + /// # use actix_web::middleware::Logger; /// # fn parse_jwt_id (_req: Option<&HeaderValue>) -> String { "jwt_uid".to_owned() } /// Logger::new("example %{JWT_ID}xi") /// .custom_request_replace("JWT_ID", |req| parse_jwt_id(req.headers().get("Authorization"))); diff --git a/src/resource.rs b/src/resource.rs index 7211c4728..420374a86 100644 --- a/src/resource.rs +++ b/src/resource.rs @@ -298,7 +298,7 @@ where /// ``` /// use actix_service::Service; /// use actix_web::{web, App}; - /// use actix_web::http::{header::CONTENT_TYPE, HeaderValue}; + /// use actix_web::http::header::{CONTENT_TYPE, HeaderValue}; /// /// async fn index() -> &'static str { /// "Welcome!" diff --git a/src/scope.rs b/src/scope.rs index b17da5e5a..ad102b66b 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -347,7 +347,7 @@ where /// ``` /// use actix_service::Service; /// use actix_web::{web, App}; - /// use actix_web::http::{header::CONTENT_TYPE, HeaderValue}; + /// use actix_web::http::header::{CONTENT_TYPE, HeaderValue}; /// /// async fn index() -> &'static str { /// "Welcome!"