Simplify FormConfig/QueryConfig doc examples.

This commit is contained in:
Robert G. Jakabosky 2020-09-10 21:46:10 +08:00
parent 35a0dae4e4
commit fcbff5ad19
No known key found for this signature in database
GPG Key ID: 0C38AF433FE0B1C0
2 changed files with 4 additions and 4 deletions

View File

@ -195,7 +195,7 @@ impl<T: Serialize> Responder for Form<T> {
/// web::resource("/index.html") /// web::resource("/index.html")
/// // change `Form` extractor configuration /// // change `Form` extractor configuration
/// .app_data( /// .app_data(
/// web::Form::<FormData>::configure(|cfg| cfg.limit(4097)) /// web::FormConfig::default().limit(4097)
/// ) /// )
/// .route(web::get().to(index)) /// .route(web::get().to(index))
/// ); /// );

View File

@ -188,12 +188,12 @@ where
/// let app = App::new().service( /// let app = App::new().service(
/// web::resource("/index.html").app_data( /// web::resource("/index.html").app_data(
/// // change query extractor configuration /// // change query extractor configuration
/// web::Query::<Info>::configure(|cfg| { /// web::QueryConfig::default()
/// cfg.error_handler(|err, req| { // <- create custom error response /// .error_handler(|err, req| { // <- create custom error response
/// error::InternalError::from_response( /// error::InternalError::from_response(
/// err, HttpResponse::Conflict().finish()).into() /// err, HttpResponse::Conflict().finish()).into()
/// }) /// })
/// })) /// )
/// .route(web::post().to(index)) /// .route(web::post().to(index))
/// ); /// );
/// } /// }