Apply suggested improvements.

This commit is contained in:
Robert G. Jakabosky 2020-09-10 13:56:45 +08:00
parent c51c7c7521
commit 18887ac97a
No known key found for this signature in database
GPG Key ID: 0C38AF433FE0B1C0
1 changed files with 3 additions and 1 deletions

View File

@ -212,6 +212,7 @@ where
/// # Examples /// # Examples
/// ///
/// Global extractor configuration: /// Global extractor configuration:
///
/// ```rust /// ```rust
/// use actix_web::{error, web, App, FromRequest, HttpResponse}; /// use actix_web::{error, web, App, FromRequest, HttpResponse};
/// use serde_derive::Deserialize; /// use serde_derive::Deserialize;
@ -247,6 +248,7 @@ where
/// ``` /// ```
/// ///
/// Per-type extractor configuration: /// Per-type extractor configuration:
///
/// ```rust /// ```rust
/// use actix_web::{error, web, App, FromRequest, HttpRequest, HttpResponse}; /// use actix_web::{error, web, App, FromRequest, HttpRequest, HttpResponse};
/// use serde_derive::Deserialize; /// use serde_derive::Deserialize;
@ -278,7 +280,7 @@ where
/// let app = App::new().service( /// let app = App::new().service(
/// web::resource("/index.html") /// web::resource("/index.html")
/// .app_data( /// .app_data(
/// // Json extractor configuration for only the `Info` struct. /// // JSON extractor configuration for the `Info` struct only.
/// web::Json::<Info>::configure(|cfg| { /// web::Json::<Info>::configure(|cfg| {
/// cfg.limit(4096) /// cfg.limit(4096)
/// .content_type(|mime| { // <- accept text/plain content type /// .content_type(|mime| { // <- accept text/plain content type