From 7e07687b5ec14bd788b8d2dd3f0a7ead83842fd4 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Sat, 28 Jan 2023 14:22:29 -0500 Subject: clippy my beloved --- src/api/auth.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/api/auth.rs') diff --git a/src/api/auth.rs b/src/api/auth.rs index 253e982..410b643 100644 --- a/src/api/auth.rs +++ b/src/api/auth.rs @@ -5,16 +5,16 @@ use tower_cookies::{Cookies, Cookie}; use crate::types::{user::User, response::ResponseCode, session::Session, extract::{Json, AuthorizedUser, Check, CheckResult, Log}}; -#[derive(Deserialize)] -struct RegistrationRequet { - firstname: String, - lastname: String, - email: String, - password: String, - gender: String, - day: u8, - month: u8, - year: u32 +#[derive(Deserialize, Debug)] +pub struct RegistrationRequet { + pub firstname: String, + pub lastname: String, + pub email: String, + pub password: String, + pub gender: String, + pub day: u8, + pub month: u8, + pub year: u32 } impl Check for RegistrationRequet { @@ -34,7 +34,7 @@ impl Check for RegistrationRequet { async fn register(cookies: Cookies, Json(body): Json) -> Response { - let user = match User::new(body.firstname, body.lastname, body.email, body.password, body.gender, body.day, body.month, body.year) { + let user = match User::new(body) { Ok(user) => user, Err(err) => return err }; -- cgit v1.2.3-freya