diff options
Diffstat (limited to 'src/commands/zoxide.rs')
-rw-r--r-- | src/commands/zoxide.rs | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/commands/zoxide.rs b/src/commands/zoxide.rs index 1abe9f2..9ee1bf6 100644 --- a/src/commands/zoxide.rs +++ b/src/commands/zoxide.rs @@ -27,14 +27,12 @@ pub fn zoxide_query(context: &mut AppContext, args: &str) -> JoshutoResult { context .message_queue_mut() .push_info(format!("z {:?}", zoxide_path)); - change_directory::change_directory(context, &path)?; - } - } else { - if let Ok(zoxide_str) = std::str::from_utf8(&zoxide_output.stderr) { - context - .message_queue_mut() - .push_error(zoxide_str.to_string()); + change_directory::change_directory(context, path)?; } + } else if let Ok(zoxide_str) = std::str::from_utf8(&zoxide_output.stderr) { + context + .message_queue_mut() + .push_error(zoxide_str.to_string()); } Ok(()) } @@ -65,14 +63,12 @@ pub fn zoxide_query_interactive( context .message_queue_mut() .push_info(format!("zi {:?}", zoxide_path)); - change_directory::change_directory(context, &path)?; - } - } else { - if let Ok(zoxide_str) = std::str::from_utf8(&zoxide_output.stderr) { - context - .message_queue_mut() - .push_error(zoxide_str.to_string()); + change_directory::change_directory(context, path)?; } + } else if let Ok(zoxide_str) = std::str::from_utf8(&zoxide_output.stderr) { + context + .message_queue_mut() + .push_error(zoxide_str.to_string()); } Ok(()) } |