Should be the last of the warning fixes

This commit is contained in:
kdeng00
2025-07-02 19:08:12 -04:00
parent 14fb2fd122
commit f5d4c81d25
4 changed files with 114 additions and 145 deletions
+7 -9
View File
@@ -16,7 +16,7 @@ impl Default for TokenManager {
token.init();
return token;
token
}
}
@@ -26,7 +26,7 @@ impl TokenManager {
let url = self.retrieve_url();
println!("URL: {}", url);
println!("URL: {url}");
let mut token = icarus_models::token::AccessToken {
user_id: uuid::Uuid::nil(),
@@ -43,9 +43,7 @@ impl TokenManager {
match response.status() {
reqwest::StatusCode::OK => {
// on success, parse our JSON to an APIResponse
let s = response.json::<icarus_models::token::AccessToken>().await;
match s {
//
match response.json::<icarus_models::token::AccessToken>().await {
Ok(parsed) => {
token = parsed;
}
@@ -56,17 +54,17 @@ impl TokenManager {
println!("Need to grab a new token");
}
other => {
panic!("Uh oh! Something unexpected happened: {:?}", other);
panic!("Uh oh! Something unexpected happened: {other:?}");
}
}
return Ok(token);
Ok(token)
}
pub fn init(&mut self) {
let api = &mut self.api;
api.version = String::from("v1");
api.endpoint = String::from(format!("api/{}/login", api.version));
api.endpoint = format!("api/{}/login", api.version);
}
pub fn retrieve_url(&self) -> String {
@@ -74,6 +72,6 @@ impl TokenManager {
let mut url = String::from(&api.url);
url += &String::from(&api.endpoint);
return url;
url
}
}