Skip to content

Commit

Permalink
refactor: improve options handling in Scimon struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Kremilly committed Jul 24, 2024
1 parent e56fa38 commit db1afd0
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/scimon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@ pub struct Scimon;
impl Scimon {

async fn options(options: &str) -> Result<(), Box<dyn Error>> {
if options == "open-env" {
Env::open_env_file()?;
} else if options == "open-settings" {
Settings::open_settings_file()?;
} else if options == "download-env" {
DownloadConfigsFiles::env_file(true, true).await?;
} else if options == "download-settings" {
DownloadConfigsFiles::settings_file(true, true).await?;
}
match options {
"open-env" => Env::open_env_file()?,
"open-settings" => Settings::open_settings_file()?,
"download-env" => DownloadConfigsFiles::env_file(true, true).await?,
"download-settings" => DownloadConfigsFiles::settings_file(true, true).await?,
_ => (),
};

Ok(())
}
Expand Down

0 comments on commit db1afd0

Please sign in to comment.