From 0ddb72f6b041783b0bad384608bddb9def5e9ad4 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Thu, 7 Apr 2022 15:55:55 +0100 Subject: [PATCH] remove references to .data() --- content/docs/extractors.md | 2 +- examples/databases/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/extractors.md b/content/docs/extractors.md index 10a9e58..8495f29 100644 --- a/content/docs/extractors.md +++ b/content/docs/extractors.md @@ -40,7 +40,7 @@ The [_Query_][querystruct] type provides extraction functionality for the reques {{< include-example example="extractors" file="json_one.rs" section="json-one" >}} -Some extractors provide a way to configure the extraction process. To configure an extractor, pass its configuration object to the resource's `.data()` method. In the case of _Json_ extractor it returns a [_JsonConfig_][jsonconfig]. You can configure the maximum size of the JSON payload as well as a custom error handler function. +Some extractors provide a way to configure the extraction process. To configure an extractor, pass its configuration object to the resource's `.app_data()` method. In the case of _Json_ extractor it returns a [_JsonConfig_][jsonconfig]. You can configure the maximum size of the JSON payload as well as a custom error handler function. The following example limits the size of the payload to 4kb and uses a custom error handler. diff --git a/examples/databases/src/main.rs b/examples/databases/src/main.rs index a785804..6d50adf 100644 --- a/examples/databases/src/main.rs +++ b/examples/databases/src/main.rs @@ -36,7 +36,7 @@ async fn main() -> io::Result<()> { // Start HTTP server HttpServer::new(move || { - App::new().data(pool.clone()) + App::new().app_data(web::Data::new(pool.clone())) .resource("/{name}", web::get().to(index)) }) .bind(("127.0.0.1", 8080))?