diff options
author | Dessalines <tyhou13@gmx.com> | 2019-11-01 23:43:21 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-11-01 23:43:21 -0700 |
commit | 3350599901b4d2232627a5451104f80c5022593d (patch) | |
tree | 1dc949c9cce62bc8074856b2c8d2330be86ef61d /server/src/api/user.rs | |
parent | 68e4b61808ee76730cdc9f4302700a60a2ebb3b5 (diff) |
Running cargo fmt.
Diffstat (limited to 'server/src/api/user.rs')
-rw-r--r-- | server/src/api/user.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/server/src/api/user.rs b/server/src/api/user.rs index ee4070c5..50d3feb7 100644 --- a/server/src/api/user.rs +++ b/server/src/api/user.rs @@ -1,7 +1,7 @@ use super::*; +use crate::{generate_random_string, send_email}; use bcrypt::verify; use std::str::FromStr; -use crate::{generate_random_string,send_email}; #[derive(Serialize, Deserialize, Debug)] pub struct Login { @@ -140,7 +140,6 @@ pub struct DeleteAccount { auth: String, } - #[derive(Serialize, Deserialize)] pub struct PasswordReset { email: String, @@ -840,7 +839,7 @@ impl Perform<PasswordResetResponse> for Oper<PasswordReset> { // Generate a random token let token = generate_random_string(); - + // Insert the row PasswordResetRequest::create_token(&conn, user.id, &token)?; @@ -852,12 +851,7 @@ impl Perform<PasswordResetResponse> for Oper<PasswordReset> { let html = &format!("<h1>Password Reset Request for {}</h1><br><a href={}/password_change/{}>Click here to reset your password</a>", user.name, hostname, &token); match send_email(subject, user_email, &user.name, html) { Ok(_o) => _o, - Err(_e) => { - return Err(APIError::err( - &self.op, - &_e.to_string(), - ))? - } + Err(_e) => return Err(APIError::err(&self.op, &_e.to_string()))?, }; Ok(PasswordResetResponse { |