refactor: ♻️ refactor and update dependencies

This commit is contained in:
Ahmet Kaan GÜMÜŞ 2024-04-14 23:48:14 +03:00
parent 73f624b14f
commit 0f31fd54ea
10 changed files with 107 additions and 83 deletions

View file

@ -77,20 +77,16 @@ pub async fn server_status_check(
}
pub async fn coin_status_check(server_address: &String) -> Option<CoinStatus> {
match reqwest::get(format!("{}{}", server_address, "/coin")).await {
Ok(response) => {
match response.json::<CoinStatus>().await {
Ok(coin_status)=> {
Some(coin_status)
}
Err(err_val) => {
log::error!("Error: Can't Deserialise -> {}", err_val);
None
}
Ok(response) => match response.json::<CoinStatus>().await {
Ok(coin_status) => Some(coin_status),
Err(err_val) => {
log::error!("Error: Can't Deserialise -> {}", err_val);
None
}
},
Err(err_val) => {
log::error!("Error: Response from Server -> {}", err_val);
None
},
}
}
}