From 4cbe4ca41d6367b154014504adc2a19dbe38c17e Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Sun, 7 Apr 2024 22:42:55 -0400 Subject: [PATCH] rustfmt --- src/main.rs | 8 +++---- src/managers/action_managers.rs | 17 ++++++--------- src/managers/commit_manager.rs | 37 +++++++++++++++------------------ src/managers/mod.rs | 2 +- src/managers/user_manager.rs | 3 +-- src/models/icarus_action.rs | 3 +-- src/models/mod.rs | 2 +- src/models/song.rs | 6 ++---- src/models/upload_form.rs | 2 +- src/models/user.rs | 14 ++++++------- 10 files changed, 41 insertions(+), 53 deletions(-) diff --git a/src/main.rs b/src/main.rs index 46efc53..f1313c6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,14 +4,13 @@ mod models; use std::env; use std::process; - - fn exit_program(code: i32) { process::exit(code); } fn print_help() { - let msg: String = String::from(r#"icd [Action] [flag] + let msg: String = String::from( + r#"icd [Action] [flag] Actions download @@ -47,7 +46,8 @@ fn print_help() { -rt retrieve type (songs is only accepted) Required for deleting a song - -D song id"#); + -D song id"#, + ); println!("{}", msg); } diff --git a/src/managers/action_managers.rs b/src/managers/action_managers.rs index b4029a8..487e4f7 100644 --- a/src/managers/action_managers.rs +++ b/src/managers/action_managers.rs @@ -27,16 +27,13 @@ impl ActionManager { } // TODO: Implement - fn supported_actions(&self) { - } + fn supported_actions(&self) {} // TODO: Implement - fn initialize(&self) { - } + fn initialize(&self) {} // TODO: Implement - fn validate_flags(&self) { - } + fn validate_flags(&self) {} // TODO: Implement - fn is_valid_flag(&self, flag: &String) -> bool{ + fn is_valid_flag(&self, flag: &String) -> bool { return false; } // TODO: Implement @@ -44,11 +41,9 @@ impl ActionManager { return false; } // TODO: Implement - fn print_action(&self) { - } + fn print_action(&self) {} // TODO: Implement - fn print_flags(&self) { - } + fn print_flags(&self) {} // TODO: Implement fn parsed_flags(&self) -> Vec { return Vec::new(); diff --git a/src/managers/commit_manager.rs b/src/managers/commit_manager.rs index 12dfa8a..dc0ec22 100644 --- a/src/managers/commit_manager.rs +++ b/src/managers/commit_manager.rs @@ -23,7 +23,6 @@ pub struct Album { pub track_count: i32, pub disc_count: i32, pub songs: Vec, - } enum ActionValues { @@ -35,19 +34,17 @@ enum ActionValues { } enum RetrieveTypes { - Songs + Songs, } impl Album { // TODO: Implement - pub fn print_info(&self) { - } + pub fn print_info(&self) {} } impl CommitManager { // TODO: Implement - pub fn commit_action(&self) { - } + pub fn commit_action(&self) {} // TODO: Implement fn map_actions(&self) -> HashMap { @@ -55,24 +52,24 @@ impl CommitManager { } // TODO: Implement - fn parse_token(&self, api: &models::api::API) { + fn parse_token(&self, api: &models::api::API) {} + // TODO: Implement + fn upload_song_with_metadata(&self) {} + // TODO: Implement + fn sing_target_upload( + &self, + songpath: &String, + track_id: &String, + meta_path: &String, + cover_path: &String, + ) { } // TODO: Implement - fn upload_song_with_metadata(&self) { - } + fn multi_target_upload(&self, sourcepath: &String) {} // TODO: Implement - fn sing_target_upload(&self, songpath: &String, track_id: &String, - meta_path: &String, cover_path: &String) { - } + fn initialize_disc_and_track(&self, song: &models::song::Song) {} // TODO: Implement - fn multi_target_upload(&self, sourcepath: &String) { - } - // TODO: Implement - fn initialize_disc_and_track(&self, song: &models::song::Song) { - } - // TODO: Implement - fn parse_disc_and_track(&self, song: &models::song::Song, track_id: &String) { - } + fn parse_disc_and_track(&self, song: &models::song::Song, track_id: &String) {} // TODO: Implement fn check_for_no_confirm(&self) -> bool { return false; diff --git a/src/managers/mod.rs b/src/managers/mod.rs index 33e3254..3699871 100644 --- a/src/managers/mod.rs +++ b/src/managers/mod.rs @@ -1,3 +1,3 @@ pub mod action_managers; pub mod commit_manager; -pub mod user_manager; \ No newline at end of file +pub mod user_manager; diff --git a/src/managers/user_manager.rs b/src/managers/user_manager.rs index bd81d31..bafc7da 100644 --- a/src/managers/user_manager.rs +++ b/src/managers/user_manager.rs @@ -20,7 +20,6 @@ impl UserManager { } // TODO: Implement - fn parse_user_from_actions(&self) { - } + fn parse_user_from_actions(&self) {} } // } diff --git a/src/models/icarus_action.rs b/src/models/icarus_action.rs index d246f43..47916ce 100644 --- a/src/models/icarus_action.rs +++ b/src/models/icarus_action.rs @@ -17,7 +17,6 @@ impl IcarusAction { } // TODO: Implement - pub fn print_action_and_flags(&self) { - } + pub fn print_action_and_flags(&self) {} } // } diff --git a/src/models/mod.rs b/src/models/mod.rs index 5da7165..986c861 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -4,4 +4,4 @@ pub mod icarus_action; pub mod song; pub mod token; pub mod upload_form; -pub mod user; \ No newline at end of file +pub mod user; diff --git a/src/models/song.rs b/src/models/song.rs index 08b49d0..d7ce412 100644 --- a/src/models/song.rs +++ b/src/models/song.rs @@ -22,8 +22,7 @@ pub struct Song { impl Song { // TODO: Implement - pub fn print_info(&self) { - } + pub fn print_info(&self) {} // TODO: Implement pub fn song_path(&self) -> String { @@ -41,11 +40,10 @@ impl Song { } } - #[derive(Debug, Deserialize, Serialize)] pub struct CoverArt { pub id: i32, pub title: String, pub path: String, } -// } \ No newline at end of file +// } diff --git a/src/models/upload_form.rs b/src/models/upload_form.rs index e7f4edc..4ca2548 100644 --- a/src/models/upload_form.rs +++ b/src/models/upload_form.rs @@ -7,4 +7,4 @@ pub struct UploadForm { pub url: String, pub filepath: String, } -// } \ No newline at end of file +// } diff --git a/src/models/user.rs b/src/models/user.rs index 2790a96..3f6d277 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -1,9 +1,9 @@ // mod models { - use serde::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; - #[derive(Debug, Deserialize, Serialize)] - pub struct User { - pub username: String, - pub password: String, - } -// } \ No newline at end of file +#[derive(Debug, Deserialize, Serialize)] +pub struct User { + pub username: String, + pub password: String, +} +// }