diff options
| author | a-kenji <aks.kenji@protonmail.com> | 2022-06-15 14:03:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-15 14:03:11 +0200 |
| commit | 3de59dac42c05de43beba2f7d09b07111c711394 (patch) | |
| tree | 4fa43bd6a337b781f3883c959ce0713369efd7e2 /src/commands.rs | |
| parent | fix: remove obsolete logs (#1504) (diff) | |
| download | sl0ppij-3de59dac42c05de43beba2f7d09b07111c711394.tar.gz sl0ppij-3de59dac42c05de43beba2f7d09b07111c711394.tar.xz sl0ppij-3de59dac42c05de43beba2f7d09b07111c711394.zip | |
fix(clippy): clippy fixes (#1508)
* fix(clippy): clippy fixes
* chore(fmt): cargo fmt
Diffstat (limited to 'src/commands.rs')
| -rw-r--r-- | src/commands.rs | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/src/commands.rs b/src/commands.rs index 7715d435..ae3d4f84 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -140,43 +140,40 @@ pub(crate) fn send_action_to_session(opts: zellij_utils::cli::CliArgs) { fn attach_with_fake_client(opts: zellij_utils::cli::CliArgs, name: &str) { if let Some(zellij_utils::cli::Command::Sessions(zellij_utils::cli::Sessions::Action { - action, + action: Some(action), })) = opts.command.clone() { - if let Some(action) = action.clone() { - let action = format!("[{}]", action); - match zellij_utils::serde_yaml::from_str::<ActionsFromYaml>(&action).into_diagnostic() { - Ok(parsed) => { - let (config, _, config_options) = match Setup::from_options(&opts) { - Ok(results) => results, - Err(e) => { - eprintln!("{}", e); - process::exit(1); - }, - }; - let os_input = - get_os_input(zellij_client::os_input_output::get_client_os_input); + let action = format!("[{}]", action); + match zellij_utils::serde_yaml::from_str::<ActionsFromYaml>(&action).into_diagnostic() { + Ok(parsed) => { + let (config, _, config_options) = match Setup::from_options(&opts) { + Ok(results) => results, + Err(e) => { + eprintln!("{}", e); + process::exit(1); + }, + }; + let os_input = get_os_input(zellij_client::os_input_output::get_client_os_input); - let actions = parsed.actions().to_vec(); - log::debug!("Starting fake Zellij client!"); - zellij_client::fake_client::start_fake_client( - Box::new(os_input), - opts, - *Box::new(config), - config_options, - ClientInfo::New(name.to_string()), - None, - actions, - ); - log::debug!("Quitting fake client now."); - std::process::exit(0); - }, - Err(e) => { - eprintln!("{:?}", e); - std::process::exit(1); - }, - }; - } + let actions = parsed.actions().to_vec(); + log::debug!("Starting fake Zellij client!"); + zellij_client::fake_client::start_fake_client( + Box::new(os_input), + opts, + *Box::new(config), + config_options, + ClientInfo::New(name.to_string()), + None, + actions, + ); + log::debug!("Quitting fake client now."); + std::process::exit(0); + }, + Err(e) => { + eprintln!("{:?}", e); + std::process::exit(1); + }, + }; }; } |
