.. [no ci]

This commit is contained in:
sxyazi 2023-12-29 02:21:44 +08:00
parent 09ee8dc2b7
commit 538a0b8e6f
No known key found for this signature in database
4 changed files with 8 additions and 8 deletions

View file

@ -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)?,
}

View file

@ -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?;

View file

@ -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!()

View file

@ -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 {