Warning fixes

This commit is contained in:
kdeng00
2025-07-01 22:23:37 -04:00
parent cf95caef50
commit 3e96bea7be
9 changed files with 57 additions and 51 deletions
+10 -4
View File
@@ -2,13 +2,14 @@ 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/");
@@ -16,11 +17,14 @@ fn retrieve_url_reg(api: &models::api::API) -> String {
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);
@@ -28,6 +32,8 @@ fn retrieve_url_with_id(api: &models::api::API, id: &uuid::Uuid) -> String {
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
}