linting issues

This commit is contained in:
Chris Cochrun 2024-06-25 06:30:09 -05:00
parent 9b70af3dba
commit 0330876377
7 changed files with 128 additions and 368 deletions

View file

@ -39,17 +39,13 @@ pub async fn camp_form(MultipartForm(form): MultipartForm<CampForm>) -> 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<CampForm>) -> 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();