summaryrefslogtreecommitdiffstats
path: root/src/commands/file_ops/copy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/file_ops/copy.rs')
-rw-r--r--src/commands/file_ops/copy.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/commands/file_ops/copy.rs b/src/commands/file_ops/copy.rs
index a7edbef..7e05752 100644
--- a/src/commands/file_ops/copy.rs
+++ b/src/commands/file_ops/copy.rs
@@ -1,9 +1,10 @@
use crate::commands::{JoshutoCommand, JoshutoRunnable};
use crate::context::JoshutoContext;
use crate::error::JoshutoResult;
+use crate::io::FileOp;
use crate::ui::TuiBackend;
-use super::local_state::{FileOp, LocalState};
+use super::local_state::LocalState;
#[derive(Clone, Debug)]
pub struct CopyFiles;
@@ -28,13 +29,9 @@ impl std::fmt::Display for CopyFiles {
impl JoshutoRunnable for CopyFiles {
fn execute(&self, context: &mut JoshutoContext, _: &mut TuiBackend) -> JoshutoResult<()> {
let curr_tab = context.curr_tab_ref();
- match curr_tab.curr_list_ref() {
- Some(list) => {
- LocalState::repopulated_selected_files(list)?;
- LocalState::set_file_op(FileOp::Copy);
- LocalState::set_tab_src(context.curr_tab_index);
- }
- None => {}
+ if let Some(list) = curr_tab.curr_list_ref() {
+ LocalState::repopulate(list)?;
+ LocalState::set_file_op(FileOp::Copy);
}
Ok(())
}