diff --git a/yazi-scheduler/src/file/file.rs b/yazi-scheduler/src/file/file.rs index 1cfe40c3..496e54c8 100644 --- a/yazi-scheduler/src/file/file.rs +++ b/yazi-scheduler/src/file/file.rs @@ -27,20 +27,20 @@ impl File { pub(crate) async fn paste(&self, mut task: FileInPaste) -> Result<(), FileOutPaste> { if task.cut - && !task.follow1 + && !task.follow && ok_or_not_found(provider::rename(&task.from, &task.to).await).is_ok() { return Ok(self.ops.out(task.id, FileOutPaste::Succ)); } if task.cha.is_none() { - task.cha = Some(Self::cha(&task.from, task.follow1, None).await?); + task.cha = Some(Self::cha(&task.from, task.follow, None).await?); } let cha = task.cha.unwrap(); if !cha.is_dir() { let id = task.id; - if cha.is_orphan() || (cha.is_link() && !task.follow1) { + if cha.is_orphan() || (cha.is_link() && !task.follow) { self.ops.out(id, FileOutPaste::New(0)); self.queue(task.into_link(), NORMAL); } else { @@ -76,7 +76,7 @@ impl File { let mut it = continue_unless_ok!(provider::read_dir(&src).await); while let Ok(Some(entry)) = it.next().await { let from = entry.url(); - let cha = continue_unless_ok!(Self::cha(&from, task.follow1, Some(entry)).await); + let cha = continue_unless_ok!(Self::cha(&from, task.follow, Some(entry)).await); if cha.is_dir() { dirs.push_back(from); @@ -84,7 +84,7 @@ impl File { } let to = continue_unless_ok!(dest.try_join(from.name().unwrap())); - if cha.is_orphan() || (cha.is_link() && !task.follow1) { + if cha.is_orphan() || (cha.is_link() && !task.follow) { self.ops.out(task.id, FileOutPaste::New(0)); self.queue(task.spawn(from, to, cha).into_link(), NORMAL); } else { @@ -111,12 +111,12 @@ impl File { } Ok(n) => self.ops.out(task.id, FileOutPasteDo::Adv(n)), Err(e) if e.kind() == NotFound => { - let Ok(cha) = Self::cha(&task.from, task.follow1, None).await else { + let Ok(cha) = Self::cha(&task.from, task.follow, None).await else { warn!("Paste task partially done: {task:?}"); break; }; - if cha.is_orphan() || (cha.is_link() && !task.follow1) { + if cha.is_orphan() || (cha.is_link() && !task.follow) { task.cha = Some(cha); return Ok(self.queue(task.into_link(), NORMAL)); } diff --git a/yazi-scheduler/src/file/in.rs b/yazi-scheduler/src/file/in.rs index af0673b1..f56b07c3 100644 --- a/yazi-scheduler/src/file/in.rs +++ b/yazi-scheduler/src/file/in.rs @@ -6,13 +6,13 @@ use yazi_shared::{Id, url::UrlBuf}; // --- Paste #[derive(Clone, Debug)] pub(crate) struct FileInPaste { - pub(crate) id: Id, - pub(crate) from: UrlBuf, - pub(crate) to: UrlBuf, - pub(crate) cha: Option, - pub(crate) cut: bool, - pub(crate) follow1: bool, - pub(crate) retry: u8, + pub(crate) id: Id, + pub(crate) from: UrlBuf, + pub(crate) to: UrlBuf, + pub(crate) cha: Option, + pub(crate) cut: bool, + pub(crate) follow: bool, + pub(crate) retry: u8, } impl FileInPaste { @@ -23,7 +23,7 @@ impl FileInPaste { to, cha: Some(cha), cut: self.cut, - follow1: self.follow1, + follow: self.follow, retry: self.retry, } } diff --git a/yazi-scheduler/src/scheduler.rs b/yazi-scheduler/src/scheduler.rs index 79017f8c..f14547ec 100644 --- a/yazi-scheduler/src/scheduler.rs +++ b/yazi-scheduler/src/scheduler.rs @@ -97,12 +97,12 @@ impl Scheduler { }); let file = self.file.clone(); - let follow1 = !from.scheme().covariant(to.scheme()); + let follow = !from.scheme().covariant(to.scheme()); self.send_micro(id, LOW, async move { if !force { to = unique_name(to, must_be_dir(&from)).await?; } - file.paste(FileInPaste { id, from, to, cha: None, cut: true, follow1, retry: 0 }).await + file.paste(FileInPaste { id, from, to, cha: None, cut: true, follow, retry: 0 }).await }); } @@ -118,12 +118,12 @@ impl Scheduler { } let file = self.file.clone(); - let follow1 = follow || !from.scheme().covariant(to.scheme()); + let follow = follow || !from.scheme().covariant(to.scheme()); self.send_micro(id, LOW, async move { if !force { to = unique_name(to, must_be_dir(&from)).await?; } - file.paste(FileInPaste { id, from, to, cha: None, cut: false, follow1, retry: 0 }).await + file.paste(FileInPaste { id, from, to, cha: None, cut: false, follow, retry: 0 }).await }); }