Code formatting

This commit is contained in:
kdeng00
2025-07-02 19:11:09 -04:00
parent e24a15ad59
commit 08c38191d6
5 changed files with 8 additions and 23 deletions
+8 -19
View File
@@ -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);
} }
} }
-1
View File
@@ -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()
-1
View File
@@ -8,4 +8,3 @@ pub struct Api {
pub endpoint: String, pub endpoint: String,
pub version: String, pub version: String,
} }
-1
View File
@@ -7,4 +7,3 @@ pub struct Flags {
pub flag: String, pub flag: String,
pub value: String, pub value: String,
} }
-1
View File
@@ -7,4 +7,3 @@ pub struct UploadForm {
pub url: Option<String>, pub url: Option<String>,
pub filepath: Option<String>, pub filepath: Option<String>,
} }