pub fn update_password(un: String, update_password: UpdatePassword, conn: &PgConnection) -> bool {
        let new_hash = hash(&update_password.password, DEFAULT_COST).unwrap();

        diesel::update(users.filter(users::username.eq(un)))
            .set(users::password_hash.eq(new_hash))
            .execute(conn)
            .is_ok()
    }
/// Attempts to update the password for the user with username `un` to the new password in `update_password`.
/// Returns true if successful or false otherwise.
Attempts to update the password for the user with username `un` to the new password in `update_password`.
Returns true if successful or false otherwise.
Attempts to update the password for the user with username ` un ` to the new password in ` update_password ` . Returns true if successful or false otherwise .
pub fn update_password(un: String, update_password: UpdatePassword, conn: &PgConnection) -> bool {
        let new_hash = hash(&update_password.password, DEFAULT_COST).unwrap();
        diesel::update(users.filter(users::username.eq(un)))
            .set(users::password_hash.eq(new_hash))
            .execute(conn)
            .is_ok()
    }
pub fn update_password ( un : String , update_password : UpdatePassword , conn : & PgConnection ) -> bool { let new_hash = hash ( & update_password . password , DEFAULT_COST ) . unwrap ( ) ; diesel :: update ( users . filter ( users :: username . eq ( un ) ) ) . set ( users :: password_hash . eq ( new_hash ) ) . execute ( conn ) . is_ok ( ) }
Attempts to update the password for the user with username `un` to the new password in `update_password`.
Attempts to update the password for the user with username ` un ` to the new password in ` update_password ` .
un
String
update_password
UpdatePassword
conn
&PgConnection
un
String
update_password
UpdatePassword
conn
&PgConnection