summaryrefslogtreecommitdiffstats
path: root/src/commands/open_file.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/open_file.rs')
-rw-r--r--src/commands/open_file.rs23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/commands/open_file.rs b/src/commands/open_file.rs
index 48c0d0b..24acae1 100644
--- a/src/commands/open_file.rs
+++ b/src/commands/open_file.rs
@@ -72,11 +72,11 @@ where
S: AsRef<std::ffi::OsStr>,
{
if option.get_fork() {
- let (child_id, handle) = fork_execute(&option, files, context.clone_event_tx())?;
+ let (child_id, handle) = fork_execute(option, files, context.clone_event_tx())?;
context.worker_context_mut().push_child(child_id, handle);
} else {
backend.terminal_drop();
- execute_and_wait(&option, files)?;
+ execute_and_wait(option, files)?;
backend.terminal_restore()?;
}
Ok(())
@@ -139,20 +139,17 @@ where
}
Ok(n) => {
let option = &options[n];
- open_with_entry(context, backend, option, &files)?;
+ open_with_entry(context, backend, option, files)?;
}
Err(_) => {
let mut args_iter = user_input.split_whitespace();
- match args_iter.next() {
- Some(cmd) => {
- backend.terminal_drop();
- let mut option = AppMimetypeEntry::new(String::from(cmd));
- option.args(args_iter);
- let res = execute_and_wait(&option, files);
- backend.terminal_restore()?;
- res?
- }
- None => {}
+ if let Some(cmd) = args_iter.next() {
+ backend.terminal_drop();
+ let mut option = AppMimetypeEntry::new(String::from(cmd));
+ option.args(args_iter);
+ let res = execute_and_wait(&option, files);
+ backend.terminal_restore()?;
+ res?
}
}
}