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:
@@ -4,18 +4,11 @@ use std::io::Error;
|
||||
use crate::models;
|
||||
use crate::syncers;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct RetrieveRecords {
|
||||
pub api: models::api::API,
|
||||
}
|
||||
|
||||
impl Default for RetrieveRecords {
|
||||
fn default() -> Self {
|
||||
RetrieveRecords {
|
||||
api: models::api::API::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl RetrieveRecords {
|
||||
pub async fn get_all_songs(
|
||||
&mut self,
|
||||
@@ -38,26 +31,13 @@ impl RetrieveRecords {
|
||||
// on success, parse our JSON to an APIResponse
|
||||
match response.json::<Vec<icarus_models::song::Song>>().await {
|
||||
Ok(parsed) => Ok(parsed),
|
||||
Err(err) => {
|
||||
return Err(std::io::Error::new(
|
||||
std::io::ErrorKind::Other,
|
||||
err.to_string(),
|
||||
));
|
||||
}
|
||||
Err(err) => Err(std::io::Error::other(err.to_string())),
|
||||
}
|
||||
}
|
||||
reqwest::StatusCode::UNAUTHORIZED => {
|
||||
return Err(std::io::Error::new(
|
||||
std::io::ErrorKind::Other,
|
||||
"Need to grab a new token",
|
||||
));
|
||||
}
|
||||
other => {
|
||||
return Err(std::io::Error::new(
|
||||
std::io::ErrorKind::Other,
|
||||
other.to_string(),
|
||||
));
|
||||
Err(std::io::Error::other("Need to grab a new token"))
|
||||
}
|
||||
other => Err(std::io::Error::other(other.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user