pub fn signup(user: UserDTO, conn: &PgConnection) -> bool {
        let new_hash = hash(&user.password, DEFAULT_COST).unwrap();

        let user = NewUser {
            username: user.username,
            email: user.email,
            preferred_name: user.preferred_name,
            password_hash: new_hash,
        };

        diesel::insert_into(users)
            .values(&user)
            .execute(conn)
            .is_ok()
    }
/// Hash the password for the given user and attempt to insert them to the users table.
Hash the password for the given user and attempt to insert them to the users table.
Hash the password for the given user and attempt to insert them to the users table .
pub fn signup(user: UserDTO, conn: &PgConnection) -> bool {
        let new_hash = hash(&user.password, DEFAULT_COST).unwrap();
        let user = NewUser {
            username: user.username,
            email: user.email,
            preferred_name: user.preferred_name,
            password_hash: new_hash,
        };
        diesel::insert_into(users)
            .values(&user)
            .execute(conn)
            .is_ok()
    }
pub fn signup ( user : UserDTO , conn : & PgConnection ) -> bool { let new_hash = hash ( & user . password , DEFAULT_COST ) . unwrap ( ) ; let user = NewUser { username : user . username , email : user . email , preferred_name : user . preferred_name , password_hash : new_hash , } ; diesel :: insert_into ( users ) . values ( & user ) . execute ( conn ) . is_ok ( ) }
Hash the password for the given user and attempt to insert them to the users table.
Hash the password for the given user and attempt to insert them to the users table .
user
UserDTO
conn
&PgConnection
user
UserDTO
conn
&PgConnection