Code formatting
This commit is contained in:
@@ -74,9 +74,7 @@ pub fn retrieve_song(
|
|||||||
if found {
|
if found {
|
||||||
Ok(song)
|
Ok(song)
|
||||||
} else {
|
} else {
|
||||||
Err(std::io::Error::other(
|
Err(std::io::Error::other("Song not found"))
|
||||||
"Song not found",
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +186,8 @@ impl CommitManager {
|
|||||||
|
|
||||||
let mut dwn_loader = syncers::download::Download { api: api.clone() };
|
let mut dwn_loader = syncers::download::Download { api: api.clone() };
|
||||||
let song = icarus_models::song::Song {
|
let song = icarus_models::song::Song {
|
||||||
id: song_id, ..Default::default()
|
id: song_id,
|
||||||
|
..Default::default()
|
||||||
};
|
};
|
||||||
let result_fut = dwn_loader.download_song(&token, &song);
|
let result_fut = dwn_loader.download_song(&token, &song);
|
||||||
match Runtime::new().unwrap().block_on(result_fut) {
|
match Runtime::new().unwrap().block_on(result_fut) {
|
||||||
@@ -376,32 +375,22 @@ impl CommitManager {
|
|||||||
}
|
}
|
||||||
Err(er) => {
|
Err(er) => {
|
||||||
println!("Some error {er:?}");
|
println!("Some error {er:?}");
|
||||||
Err(std::io::Error::other(
|
Err(std::io::Error::other(er.to_string()))
|
||||||
er.to_string(),
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
println!("Error: {err:?}");
|
println!("Error: {err:?}");
|
||||||
Err(std::io::Error::other(
|
Err(std::io::Error::other(err.to_string()))
|
||||||
err.to_string(),
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(er) => {
|
Err(er) => {
|
||||||
println!("Error: {er:?}");
|
println!("Error: {er:?}");
|
||||||
Err(std::io::Error::other(
|
Err(std::io::Error::other(er.to_string()))
|
||||||
er.to_string(),
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => {
|
_ => Err(std::io::Error::other("No sutitable file found".to_owned())),
|
||||||
Err(std::io::Error::other(
|
|
||||||
"No sutitable file found".to_owned(),
|
|
||||||
))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,7 +504,7 @@ impl CommitManager {
|
|||||||
if let En::ImageFile = self.find_file_extension(&file_name) {
|
if let En::ImageFile = self.find_file_extension(&file_name) {
|
||||||
let directory_part = directory_path.clone();
|
let directory_part = directory_path.clone();
|
||||||
let fname = utilities::string::o_to_string(&file_name);
|
let fname = utilities::string::o_to_string(&file_name);
|
||||||
let fullpath = format!("{}/{}", directory_part ,&fname.unwrap());
|
let fullpath = format!("{}/{}", directory_part, &fname.unwrap());
|
||||||
return Ok(fullpath);
|
return Ok(fullpath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ pub struct UserManager {
|
|||||||
pub ica_action: models::icarus_action::IcarusAction,
|
pub ica_action: models::icarus_action::IcarusAction,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl UserManager {
|
impl UserManager {
|
||||||
pub fn retrieve_user(&self) -> icarus_models::user::User {
|
pub fn retrieve_user(&self) -> icarus_models::user::User {
|
||||||
self.user.clone()
|
self.user.clone()
|
||||||
|
|||||||
@@ -8,4 +8,3 @@ pub struct Api {
|
|||||||
pub endpoint: String,
|
pub endpoint: String,
|
||||||
pub version: String,
|
pub version: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,3 @@ pub struct Flags {
|
|||||||
pub flag: String,
|
pub flag: String,
|
||||||
pub value: String,
|
pub value: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,3 @@ pub struct UploadForm {
|
|||||||
pub url: Option<String>,
|
pub url: Option<String>,
|
||||||
pub filepath: Option<String>,
|
pub filepath: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user