From 5d85db6e8eae574fccafef374b1f2bd990502a55 Mon Sep 17 00:00:00 2001
From: Martin Fischer <martin@push-f.com>
Date: Thu, 23 Dec 2021 23:07:04 +0100
Subject: doc: use struct destructuring

---
 examples/form/src/main.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'examples/form/src')

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())
 }
 
-- 
cgit v1.2.3