Warning fixes (#54)
* More warning fixes * Should be the last of the warning fixes * Code cleanup * Code formatting
This commit was merged in pull request #54.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::models;
|
||||
|
||||
pub fn retrieve_url(api: &models::api::API, with_id: bool, id: &uuid::Uuid) -> String {
|
||||
pub fn retrieve_url(api: &models::api::Api, with_id: bool, id: &uuid::Uuid) -> String {
|
||||
if with_id {
|
||||
retrieve_url_with_id(api, id)
|
||||
} else {
|
||||
@@ -8,13 +8,13 @@ pub fn retrieve_url(api: &models::api::API, with_id: bool, id: &uuid::Uuid) -> S
|
||||
}
|
||||
}
|
||||
|
||||
fn retrieve_url_reg(api: &models::api::API) -> String {
|
||||
fn retrieve_url_reg(api: &models::api::Api) -> String {
|
||||
let url = format!("{}/api/{}/{}/", api.url, api.version, api.endpoint);
|
||||
|
||||
url
|
||||
}
|
||||
|
||||
fn retrieve_url_with_id(api: &models::api::API, id: &uuid::Uuid) -> String {
|
||||
fn retrieve_url_with_id(api: &models::api::Api, id: &uuid::Uuid) -> String {
|
||||
let url = format!("{}/api/{}/{}/{}", api.url, api.version, api.endpoint, id);
|
||||
|
||||
url
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::syncers;
|
||||
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct Delete {
|
||||
pub api: models::api::API,
|
||||
pub api: models::api::Api,
|
||||
}
|
||||
|
||||
impl Delete {
|
||||
|
||||
@@ -5,7 +5,7 @@ use crate::syncers;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Download {
|
||||
pub api: models::api::API,
|
||||
pub api: models::api::Api,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::syncers;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct RetrieveRecords {
|
||||
pub api: models::api::API,
|
||||
pub api: models::api::Api,
|
||||
}
|
||||
|
||||
impl RetrieveRecords {
|
||||
@@ -28,7 +28,7 @@ impl RetrieveRecords {
|
||||
|
||||
match response.status() {
|
||||
reqwest::StatusCode::OK => {
|
||||
// on success, parse our JSON to an APIResponse
|
||||
// on success, parse our JSON to an API Response
|
||||
match response.json::<Vec<icarus_models::song::Song>>().await {
|
||||
Ok(parsed) => Ok(parsed),
|
||||
Err(err) => Err(std::io::Error::other(err.to_string())),
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::syncers;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Upload {
|
||||
pub api: models::api::API,
|
||||
pub api: models::api::Api,
|
||||
}
|
||||
|
||||
impl Upload {
|
||||
@@ -83,7 +83,7 @@ impl Upload {
|
||||
}
|
||||
|
||||
pub fn set_api(&mut self, host: &str) {
|
||||
let api = models::api::API {
|
||||
let api = models::api::Api {
|
||||
url: host.to_owned(),
|
||||
version: String::from("v1"),
|
||||
endpoint: String::new(),
|
||||
|
||||
Reference in New Issue
Block a user