async fn validate_user(token: &str) {
    let response = crate::utils::get(USER_URL, Some(token), 100).await;
    let text = response.unwrap().text().await.unwrap();
    let user_info: Result<UserInfo, serde_json::Error> = serde_json::from_str(&text);

    let now = Utc::now().timestamp();
//     match user_info {
//         Err(e) => {
//             error!("Invalid response body: {}", text);
//             panic!("Error while validating user: {}", e)
//         }
//         Ok(u) => {
//             if now > u.donationExpire / 1000 {
//                 panic!("Donation expired!")
//             } else if !u.didDonate {
//                 panic!("User didn't donate!")
//             }
//         }
//     }
}
// Validate the locast user and make sure the user has donated and the donation didn't expire.
// If invalid, panic.
Validate the locast user and make sure the user has donated and the donation didn't expire.
If invalid, panic.
Validate the locast user and make sure the user has donated and the donation didn ' t expire . If invalid panic .
async fn validate_user(token: &str) {
    let response = crate::utils::get(USER_URL, Some(token), 100).await;
    let text = response.unwrap().text().await.unwrap();
    let user_info: Result<UserInfo, serde_json::Error> = serde_json::from_str(&text);
    let now = Utc::now().timestamp();
//     match user_info {
//         Err(e) => {
//             error!("Invalid response body: {}", text);
//             panic!("Error while validating user: {}", e)
//         }
//         Ok(u) => {
//             if now > u.donationExpire / 1000 {
//                 panic!("Donation expired!")
//             } else if !u.didDonate {
//                 panic!("User didn't donate!")
//             }
//         }
//     }
}
async fn validate_user ( token : & str ) { let response = crate :: utils :: get ( USER_URL , Some ( token ) , 100 ) . await ; let text = response . unwrap ( ) . text ( ) . await . unwrap ( ) ; let user_info : Result < UserInfo , serde_json :: Error > = serde_json :: from_str ( & text ) ; let now = Utc :: now ( ) . timestamp ( ) ; //     match user_info { //         Err(e) => { //             error!("Invalid response body: {}", text); //             panic!("Error while validating user: {}", e) //         } //         Ok(u) => { //             if now > u.donationExpire / 1000 { //                 panic!("Donation expired!") //             } else if !u.didDonate { //                 panic!("User didn't donate!") //             } //         } //     } }
Validate the locast user and make sure the user has donated and the donation didn't expire.
Validate the locast user and make sure the user has donated and the donation didn ' t expire .
token
&str