aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-12-23 23:07:04 +0100
committerMartin Fischer <martin@push-f.com>2021-12-23 23:07:04 +0100
commit5d85db6e8eae574fccafef374b1f2bd990502a55 (patch)
tree5ef6994c738f69f96069da849407fff22947fbc0 /README.md
parent6877863329778142fd30a561fca6a91b151410d4 (diff)
doc: use struct destructuring
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 2 insertions, 2 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())
}