mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
.. [no ci]
This commit is contained in:
parent
09ee8dc2b7
commit
538a0b8e6f
4 changed files with 8 additions and 8 deletions
|
|
@ -20,9 +20,9 @@ impl File {
|
||||||
Self { macro_, prog }
|
Self { macro_, prog }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn work(&self, op: &mut FileOp) -> Result<()> {
|
pub async fn work(&self, op: FileOp) -> Result<()> {
|
||||||
match op {
|
match op {
|
||||||
FileOp::Paste(task) => {
|
FileOp::Paste(mut task) => {
|
||||||
match fs::remove_file(&task.to).await {
|
match fs::remove_file(&task.to).await {
|
||||||
Err(e) if e.kind() != NotFound => Err(e)?,
|
Err(e) if e.kind() != NotFound => Err(e)?,
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|
@ -50,7 +50,7 @@ impl File {
|
||||||
{
|
{
|
||||||
self.log(task.id, format!("Paste task retry: {:?}", task))?;
|
self.log(task.id, format!("Paste task retry: {:?}", task))?;
|
||||||
task.retry += 1;
|
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)?,
|
Err(e) => Err(e)?,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ impl Plugin {
|
||||||
Self { macro_, prog }
|
Self { macro_, prog }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn work(&self, op: &mut PluginOp) -> Result<()> {
|
pub async fn work(&self, op: PluginOp) -> Result<()> {
|
||||||
match op {
|
match op {
|
||||||
PluginOp::Entry(task) => {
|
PluginOp::Entry(task) => {
|
||||||
yazi_plugin::isolate::entry(&task.name).await?;
|
yazi_plugin::isolate::entry(&task.name).await?;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ impl Preload {
|
||||||
Self { macro_, prog, rule_loaded: Default::default(), size_loading: Default::default() }
|
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 {
|
match op {
|
||||||
PreloadOp::Rule(task) => {
|
PreloadOp::Rule(task) => {
|
||||||
todo!()
|
todo!()
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,9 @@ impl Scheduler {
|
||||||
}
|
}
|
||||||
|
|
||||||
let result = match op {
|
let result = match op {
|
||||||
TaskOp::File(mut op) => file.work(&mut op).await,
|
TaskOp::File(op) => file.work(*op).await,
|
||||||
TaskOp::Plugin(mut op) => plugin.work(&mut op).await,
|
TaskOp::Plugin(op) => plugin.work(*op).await,
|
||||||
TaskOp::Preload(mut op) => preload.work(&mut op).await,
|
TaskOp::Preload(op) => preload.work(*op).await,
|
||||||
};
|
};
|
||||||
|
|
||||||
if let Err(e) = result {
|
if let Err(e) = result {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue