chore: improve code with cargo clippy
Signed-off-by: Tomkoid <tomaszierl@outlook.com>
This commit is contained in:
parent
f0ed562a26
commit
c29d161a2b
|
@ -3,6 +3,6 @@ use crate::{repos::add_repo, AppState};
|
|||
use super::*;
|
||||
|
||||
pub fn add_repo_action(repo: String, app_state: &AppState) {
|
||||
add_repo(&repo, &app_state);
|
||||
add_repo(&repo, app_state);
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@ use super::*;
|
|||
|
||||
pub fn add_repo_preset_action(repo: String, app_state: &AppState) {
|
||||
let repo = Presets::get(repo);
|
||||
add_repo(&repo, &app_state);
|
||||
add_repo(&repo, app_state);
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -16,17 +16,17 @@ pub async fn exec_command(app_state: &AppState) {
|
|||
let args = &app_state.args;
|
||||
|
||||
match args.to_owned().command {
|
||||
Commands::Sync(_) => sync_repositories(&app_state).await,
|
||||
Commands::Apply => apply_hosts(&app_state),
|
||||
Commands::ApplyAndroid(a) => apply_android_action(&app_state, a.device),
|
||||
Commands::Backup => backup(&app_state),
|
||||
Commands::Restore => restore_backup(&app_state),
|
||||
Commands::RestoreAndroid(a) => restore_android_action(&app_state, a.device),
|
||||
Commands::AddRepo(a) => add_repo_action(a.repo, &app_state),
|
||||
Commands::AddRepoPreset(a) => add_repo_preset_action(a.repo, &app_state),
|
||||
Commands::Sync(_) => sync_repositories(app_state).await,
|
||||
Commands::Apply => apply_hosts(app_state),
|
||||
Commands::ApplyAndroid(a) => apply_android_action(app_state, a.device),
|
||||
Commands::Backup => backup(app_state),
|
||||
Commands::Restore => restore_backup(app_state),
|
||||
Commands::RestoreAndroid(a) => restore_android_action(app_state, a.device),
|
||||
Commands::AddRepo(a) => add_repo_action(a.repo, app_state),
|
||||
Commands::AddRepoPreset(a) => add_repo_preset_action(a.repo, app_state),
|
||||
Commands::DelRepo(a) => del_repo_action(a.repo),
|
||||
Commands::DelRepoPreset(a) => del_repo_preset_action(a.repo),
|
||||
Commands::ListRepos => list_repos_action(),
|
||||
Commands::ListDevices => list_devices_action(&app_state),
|
||||
Commands::ListDevices => list_devices_action(app_state),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ pub fn add_repo(repo: &String, app_state: &AppState) {
|
|||
output = format!("{}\n{}", output, repo);
|
||||
|
||||
// Check if the repo responds
|
||||
verify_repo(repo, &app_state);
|
||||
verify_repo(repo, app_state);
|
||||
|
||||
write_to_file(&file_location, output);
|
||||
|
||||
|
|
Loading…
Reference in a new issue