From 1a4ead9b74ebe84ba78a40ee4f01ce0815f905bb Mon Sep 17 00:00:00 2001
From: LukeMathWalker <rust@lpalmieri.com>
Date: Sun, 18 Oct 2020 14:22:22 +0100
Subject: [PATCH] Do not change struct name.

---
 chapter03-1/src/routes/subscriptions.rs | 4 ++--
 chapter04/src/routes/subscriptions.rs   | 9 +++------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/chapter03-1/src/routes/subscriptions.rs b/chapter03-1/src/routes/subscriptions.rs
index f9f32f4..8a79ec6 100644
--- a/chapter03-1/src/routes/subscriptions.rs
+++ b/chapter03-1/src/routes/subscriptions.rs
@@ -4,13 +4,13 @@ use sqlx::PgPool;
 use uuid::Uuid;
 
 #[derive(serde::Deserialize)]
-pub struct SubscribeRequest {
+pub struct FormData {
     email: String,
     name: String,
 }
 
 pub async fn subscribe(
-    payload: web::Form<SubscribeRequest>,
+    payload: web::Form<FormData>,
     pool: web::Data<PgPool>,
 ) -> Result<HttpResponse, HttpResponse> {
     sqlx::query!(
diff --git a/chapter04/src/routes/subscriptions.rs b/chapter04/src/routes/subscriptions.rs
index 174c36a..052270c 100644
--- a/chapter04/src/routes/subscriptions.rs
+++ b/chapter04/src/routes/subscriptions.rs
@@ -4,7 +4,7 @@ use sqlx::PgPool;
 use uuid::Uuid;
 
 #[derive(serde::Deserialize)]
-pub struct SubscribeRequest {
+pub struct FormData {
     email: String,
     name: String,
 }
@@ -18,7 +18,7 @@ pub struct SubscribeRequest {
     )
 )]
 pub async fn subscribe(
-    payload: web::Form<SubscribeRequest>,
+    payload: web::Form<FormData>,
     pool: web::Data<PgPool>,
 ) -> Result<HttpResponse, HttpResponse> {
     insert_subscriber(&pool, &payload)
@@ -31,10 +31,7 @@ pub async fn subscribe(
     name = "Saving new subscriber details in the database",
     skip(payload, pool)
 )]
-pub async fn insert_subscriber(
-    pool: &PgPool,
-    payload: &SubscribeRequest,
-) -> Result<(), sqlx::Error> {
+pub async fn insert_subscriber(pool: &PgPool, payload: &FormData) -> Result<(), sqlx::Error> {
     sqlx::query!(
         r#"
     INSERT INTO subscriptions (id, email, name, subscribed_at)