From 538a0b8e6f9efe99ff4ccca5573d17c2d4dd2d2e Mon Sep 17 00:00:00 2001 From: sxyazi Date: Fri, 29 Dec 2023 02:21:44 +0800 Subject: [PATCH] .. [no ci] --- yazi-scheduler/src/file/file.rs | 6 +++--- yazi-scheduler/src/plugin/plugin.rs | 2 +- yazi-scheduler/src/preload/preload.rs | 2 +- yazi-scheduler/src/scheduler.rs | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/yazi-scheduler/src/file/file.rs b/yazi-scheduler/src/file/file.rs index 84387de8..fc9f86d6 100644 --- a/yazi-scheduler/src/file/file.rs +++ b/yazi-scheduler/src/file/file.rs @@ -20,9 +20,9 @@ impl File { Self { macro_, prog } } - pub async fn work(&self, op: &mut FileOp) -> Result<()> { + pub async fn work(&self, op: FileOp) -> Result<()> { match op { - FileOp::Paste(task) => { + FileOp::Paste(mut task) => { match fs::remove_file(&task.to).await { Err(e) if e.kind() != NotFound => Err(e)?, _ => {} @@ -50,7 +50,7 @@ impl File { { self.log(task.id, format!("Paste task retry: {:?}", task))?; task.retry += 1; - return Ok(self.macro_.send(FileOp::Paste(task.clone()).into()).await?); + return Ok(self.macro_.send(FileOp::Paste(task).into()).await?); } Err(e) => Err(e)?, } diff --git a/yazi-scheduler/src/plugin/plugin.rs b/yazi-scheduler/src/plugin/plugin.rs index e4d02d39..c2992065 100644 --- a/yazi-scheduler/src/plugin/plugin.rs +++ b/yazi-scheduler/src/plugin/plugin.rs @@ -14,7 +14,7 @@ impl Plugin { Self { macro_, prog } } - pub async fn work(&self, op: &mut PluginOp) -> Result<()> { + pub async fn work(&self, op: PluginOp) -> Result<()> { match op { PluginOp::Entry(task) => { yazi_plugin::isolate::entry(&task.name).await?; diff --git a/yazi-scheduler/src/preload/preload.rs b/yazi-scheduler/src/preload/preload.rs index 83faedc4..01dc4dcd 100644 --- a/yazi-scheduler/src/preload/preload.rs +++ b/yazi-scheduler/src/preload/preload.rs @@ -22,7 +22,7 @@ impl Preload { Self { macro_, prog, rule_loaded: Default::default(), size_loading: Default::default() } } - pub async fn work(&self, op: &mut PreloadOp) -> Result<()> { + pub async fn work(&self, op: PreloadOp) -> Result<()> { match op { PreloadOp::Rule(task) => { todo!() diff --git a/yazi-scheduler/src/scheduler.rs b/yazi-scheduler/src/scheduler.rs index 5557c33f..d1584e1e 100644 --- a/yazi-scheduler/src/scheduler.rs +++ b/yazi-scheduler/src/scheduler.rs @@ -82,9 +82,9 @@ impl Scheduler { } let result = match op { - TaskOp::File(mut op) => file.work(&mut op).await, - TaskOp::Plugin(mut op) => plugin.work(&mut op).await, - TaskOp::Preload(mut op) => preload.work(&mut op).await, + TaskOp::File(op) => file.work(*op).await, + TaskOp::Plugin(op) => plugin.work(*op).await, + TaskOp::Preload(op) => preload.work(*op).await, }; if let Err(e) = result {