aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--examples/form/src/main.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/README.md b/README.md
index f19d3b5..9e28491 100644
--- a/README.md
+++ b/README.md
@@ -82,10 +82,10 @@ struct FormData {
}
async fn post_form(_req: &mut Parts, body: Body) -> Result<Response, Error> {
- let msg: FormData = body.into_form().await?;
+ let FormData { text } = body.into_form().await?;
Ok(Builder::new()
.content_type(mime::TEXT_HTML)
- .body(format!("hello <em>{}</em>", html_escape(msg.text)).into())
+ .body(format!("hello <em>{}</em>", html_escape(text)).into())
.unwrap())
}
diff --git a/examples/form/src/main.rs b/examples/form/src/main.rs
index af6b2af..6ef64be 100644
--- a/examples/form/src/main.rs
+++ b/examples/form/src/main.rs
@@ -45,10 +45,10 @@ struct FormData {
}
async fn post_form(_req: &mut Parts, body: Body) -> Result<Response, Error> {
- let msg: FormData = body.into_form().await?;
+ let FormData { text } = body.into_form().await?;
Ok(Builder::new()
.content_type(mime::TEXT_HTML)
- .body(format!("hello <em>{}</em>", html_escape(msg.text)).into())
+ .body(format!("hello <em>{}</em>", html_escape(text)).into())
.unwrap())
}