From 033087637743da3fef80b6db1d65a9cb010c1dcd Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Tue, 25 Jun 2024 06:30:09 -0500 Subject: [PATCH] linting issues --- src/api/camp_form.rs | 66 +++++------------- src/api/church_form.rs | 28 ++------ src/api/health_form.rs | 126 +++++++++------------------------ src/api/local_trip_form.rs | 82 ++++++---------------- src/api/mt_form.rs | 138 ++++++++++--------------------------- src/api/parent_form.rs | 32 +++------ src/api/teacher_form.rs | 24 ++----- 7 files changed, 128 insertions(+), 368 deletions(-) diff --git a/src/api/camp_form.rs b/src/api/camp_form.rs index 3fa1114..8cb2a7e 100644 --- a/src/api/camp_form.rs +++ b/src/api/camp_form.rs @@ -39,17 +39,13 @@ pub async fn camp_form(MultipartForm(form): MultipartForm) -> HttpResp let first = form .first_name .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let last = form .last_name .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let full_name = format!("{} {}", first, last); @@ -58,114 +54,86 @@ pub async fn camp_form(MultipartForm(form): MultipartForm) -> HttpResp "{} {}", form.parent_first_name .as_ref() - .unwrap_or(&Text { - 0: String::from("") - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(), form.parent_last_name .as_ref() - .unwrap_or(&Text { - 0: String::from("") - }) + .unwrap_or(&Text(String::from(""))) .0 .clone() ); let birthdate = form .birthdate .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let gender = form .gender .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let street = form .street .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let city = form .city .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let state = form .state .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); - let zip = form.zip.as_ref().unwrap_or(&Text { 0: 0 }).0.clone(); + let zip = form.zip.as_ref().unwrap_or(&Text(0)).0; let parent_phone = form .parent_phone .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let parent_email = form .parent_email .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let grade = form .grade .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let shirt = form .shirt .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let allergies = form .allergies .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let week = form .week .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let registration = form .registration .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let reg = registration.clone(); diff --git a/src/api/church_form.rs b/src/api/church_form.rs index c55ca38..32294a7 100644 --- a/src/api/church_form.rs +++ b/src/api/church_form.rs @@ -45,57 +45,43 @@ pub async fn church_form(MultipartForm(form): MultipartForm) -> Http let relationship = form .relationship .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let walk = form .walk .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let positive = form .positive .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let negative = form .negative .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let commitment = form .commitment .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let teachable = form .teachable .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let notes = form .notes .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); log::info!("{first} {last} filled out a Church Reference form!"); diff --git a/src/api/health_form.rs b/src/api/health_form.rs index 04a715f..19ea367 100644 --- a/src/api/health_form.rs +++ b/src/api/health_form.rs @@ -66,245 +66,185 @@ pub async fn health_form(MultipartForm(form): MultipartForm) -> Http let first = form .first_name .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let last = form .last_name .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let full_name = format!("{} {}", first, last); let registration = form .registration .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let email_subject = format!("{} {} filled out a health form!", first, last); - let filename_noext = String::from(format!("{}_{}", first, last)); + let filename_noext = format!("{}_{}", first, last); let parent = format!( "{} {}", form.parent_first_name .as_ref() - .unwrap_or(&Text { - 0: String::from("") - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(), form.parent_last_name .as_ref() - .unwrap_or(&Text { - 0: String::from("") - }) + .unwrap_or(&Text(String::from(""))) .0 .clone() ); let birthdate = form .birthdate .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let street = form .street .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let city = form .city .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let state = form .state .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let zip = form .zip .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let parent_cellphone = form .parent_cellphone .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let homephone = form .homephone .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let contact = form .contact .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let contact_phone = form .contact_phone .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let doctorname = form .doctorname .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let doctorcity = form .doctorcity .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let doctorphone = form .doctorphone .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let medical = form .medical .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let insurance = form .insurance .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let policy_number = form .policy_number .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let agreement = form .agreement .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let allergies = form .allergies .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let allergies_other = form .allergies_other .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let specific_allergies = form .specific_allergies .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let treatment = form .treatment .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let conditions = form .conditions .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let tetanus = form .tetanus .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let swimming = form .swimming .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let medication = form .medication .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let notes = form .notes .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); log::info!("{first} {last} filled out a health form!"); @@ -444,7 +384,7 @@ pub async fn health_form(MultipartForm(form): MultipartForm) -> Http log::info!("{:?}", file_exists); if let Some(f) = form.file { if let Some(file) = f.file_name { - if let Some(ext) = file.rsplit(".").next() { + if let Some(ext) = file.rsplit('.').next() { filename = format!("{}.{}", filename_noext, ext); path = Some(format!("./tmp/{}.{}", filename_noext, ext)); } else { @@ -565,6 +505,6 @@ pub async fn health_form(MultipartForm(form): MultipartForm) -> Http // HttpResponse::Ok().body("hi") } -async fn post_health_form(form: HealthForm) -> bool { +async fn post_health_form(_form: HealthForm) -> bool { todo!() } diff --git a/src/api/local_trip_form.rs b/src/api/local_trip_form.rs index 3c2fd22..fa38b2b 100644 --- a/src/api/local_trip_form.rs +++ b/src/api/local_trip_form.rs @@ -44,17 +44,13 @@ pub async fn local_form(MultipartForm(form): MultipartForm) -> HttpRe let first = form .first_name .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let last = form .last_name .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let email_subject = format!("{} {} signed up for the local mission trip!", first, last); @@ -62,147 +58,111 @@ pub async fn local_form(MultipartForm(form): MultipartForm) -> HttpRe "{} {}", form.parent_first_name .as_ref() - .unwrap_or(&Text { - 0: String::from("") - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(), form.parent_last_name .as_ref() - .unwrap_or(&Text { - 0: String::from("") - }) + .unwrap_or(&Text(String::from(""))) .0 .clone() ); let birthdate = form .birthdate .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let gender = form .gender .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let street = form .street .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let city = form .city .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let state = form .state .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); - let zip = form.zip.as_ref().unwrap_or(&Text { 0: 0 }).0.clone(); + let zip = form.zip.as_ref().unwrap_or(&Text(0)).0; let cellphone = form .cellphone .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let parentphone = form .parentphone .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let email = form .email .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let parentemail = form .parentemail .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let school = form .school .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let grade = form .grade .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let pastor = format!( "{} {}", form.pastor_first_name .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(), form.pastor_last_name .as_ref() - .unwrap_or(&Text { - 0: String::from("") - }) + .unwrap_or(&Text(String::from(""))) .0 .clone() ); let church_attendance = form .church_attendance .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let tfc_group = form .tfc_group .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let shirt = form .shirt .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); log::info!("{first} {last} signed up for the local mission trip!"); diff --git a/src/api/mt_form.rs b/src/api/mt_form.rs index 5cafd42..3ded04a 100644 --- a/src/api/mt_form.rs +++ b/src/api/mt_form.rs @@ -70,270 +70,204 @@ pub async fn mt_form(MultipartForm(form): MultipartForm) -> HttpResponse let first = form .first_name .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let last = form .last_name .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let email_subject = format!("{} {} signed up for mission trip!", first, last); - let filename_noext = String::from(format!("{}_{}", first, last)); + let filename_noext = format!("{}_{}", first, last); let parent = format!( "{} {}", form.parent_first_name .as_ref() - .unwrap_or(&Text { - 0: String::from("") - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(), form.parent_last_name .as_ref() - .unwrap_or(&Text { - 0: String::from("") - }) + .unwrap_or(&Text(String::from(""))) .0 .clone() ); let birthdate = form .birthdate .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let gender = form .gender .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let street = form .street .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let city = form .city .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let state = form .state .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); - let zip = form.zip.as_ref().unwrap_or(&Text { 0: 0 }).0.clone(); + let zip = form.zip.as_ref().unwrap_or(&Text(0)).0; let cellphone = form .cellphone .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let parentphone = form .parentphone .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let email = form .email .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let parentemail = form .parentemail .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let school = form .school .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let grade = form .grade .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let pastor = format!( "{} {}", form.pastor_first_name .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(), form.pastor_last_name .as_ref() - .unwrap_or(&Text { - 0: String::from("") - }) + .unwrap_or(&Text(String::from(""))) .0 .clone() ); let church_attendance = form .church_attendance .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let tfc_group = form .tfc_group .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let shirt = form .shirt .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let trip = form .trip .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let trip_notes = form .trip_notes .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let relationship = form .relationship_with_jesus .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let testimony = form .testimony .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let involvement = form .involvement_with_group .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let reasons = form .reasons .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let strengths = form .strengths .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let weaknesses = form .weaknesses .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let previous_trip = form .previous_trip_info .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let attitude = form .attitude .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let relevant = form .relevant_notes .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let final_agreement = form .final_agreement .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let registration = form .registration .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); log::info!("{first} {last} signed up for mission trip!"); @@ -489,7 +423,7 @@ pub async fn mt_form(MultipartForm(form): MultipartForm) -> HttpResponse log::info!("{:?}", file_exists); if let Some(f) = form.file { if let Some(file) = f.file_name { - if let Some(ext) = file.rsplit(".").next() { + if let Some(ext) = file.rsplit('.').next() { filename = format!("{}.{}", filename_noext, ext); path = Some(format!("./tmp/{}.{}", filename_noext, ext)); } else { diff --git a/src/api/parent_form.rs b/src/api/parent_form.rs index 7d14969..b7f133d 100644 --- a/src/api/parent_form.rs +++ b/src/api/parent_form.rs @@ -46,65 +46,49 @@ pub async fn parent_form(MultipartForm(form): MultipartForm) -> Http let email = form .email .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let authority = form .authority .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let positive = form .positive .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let negative = form .negative .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let family = form .family_relation .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let previous_trip_info = form .previous_trip_info .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let feelings = form .trip_feelings .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let notes = form .notes .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); log::info!("{first} {last} filled out a parent form!"); diff --git a/src/api/teacher_form.rs b/src/api/teacher_form.rs index 707f4f7..e3e4831 100644 --- a/src/api/teacher_form.rs +++ b/src/api/teacher_form.rs @@ -42,49 +42,37 @@ pub async fn teacher_form(MultipartForm(form): MultipartForm) -> Ht let relationship = form .relationship .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let attitudes = form .attitudes .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let positive = form .positive .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let negative = form .negative .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let team = form .team .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); let notes = form .notes .as_ref() - .unwrap_or(&Text { - 0: String::from(""), - }) + .unwrap_or(&Text(String::from(""))) .0 .clone(); log::info!("{first} {last} filled out a teacher form!");