Update dependencies (#53)
* Removing new lines * Updated reqwest, tokio, tokio-utils, and uuid * Including Cargo.lock in source control * Not sure how this got here * Updated icarus_models * Workflow change * Removing unused workflow * Github workflow fix * Warning fixes * Fixed what caused failed test * Code cleanup and formatting
This commit was merged in pull request #53.
This commit is contained in:
+6
-18
@@ -2,32 +2,20 @@ use crate::models;
|
||||
|
||||
pub fn retrieve_url(api: &models::api::API, with_id: bool, id: &uuid::Uuid) -> String {
|
||||
if with_id {
|
||||
retrieve_url_with_id(&api, id)
|
||||
retrieve_url_with_id(api, id)
|
||||
} else {
|
||||
retrieve_url_reg(&api)
|
||||
retrieve_url_reg(api)
|
||||
}
|
||||
}
|
||||
|
||||
fn retrieve_url_reg(api: &models::api::API) -> String {
|
||||
let mut url: String = String::from(&api.url);
|
||||
url += &String::from("/");
|
||||
url += &String::from("api/");
|
||||
url += &String::from(&api.version);
|
||||
url += &String::from("/");
|
||||
url += &String::from(&api.endpoint);
|
||||
url += &String::from("/");
|
||||
let url = format!("{}/api/{}/{}/", api.url, api.version, api.endpoint);
|
||||
|
||||
return url;
|
||||
url
|
||||
}
|
||||
|
||||
fn retrieve_url_with_id(api: &models::api::API, id: &uuid::Uuid) -> String {
|
||||
let mut url: String = String::from(&api.url);
|
||||
url += &String::from("api/");
|
||||
url += &String::from(&api.version);
|
||||
url += &String::from("/");
|
||||
url += &String::from(&api.endpoint);
|
||||
url += &String::from("/");
|
||||
url += &id.to_string();
|
||||
let url = format!("{}/api/{}/{}/{}", api.url, api.version, api.endpoint, id);
|
||||
|
||||
return url;
|
||||
url
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user