From 6c7fdd36fcff20952f67022ee7d9fe4f7489c1f8 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Mon, 1 Dec 2025 22:39:07 +0800 Subject: [PATCH] .. --- yazi-fs/src/provider/local/copier.rs | 4 ++-- yazi-sftp/src/fs/file.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/yazi-fs/src/provider/local/copier.rs b/yazi-fs/src/provider/local/copier.rs index 875386b7..bab205af 100644 --- a/yazi-fs/src/provider/local/copier.rs +++ b/yazi-fs/src/provider/local/copier.rs @@ -53,14 +53,14 @@ pub(super) fn copy_with_progress_impl( let (done_tx, mut done_rx) = oneshot::channel(); tokio::spawn({ - let (from, to) = (from.to_owned(), to.to_owned()); + let to = to.to_owned(); async move { done_tx.send(copy_impl(from, to, attrs).await).ok(); } }); tokio::spawn({ - let (prog_tx, to) = (prog_tx.clone(), to.to_owned()); + let prog_tx = prog_tx.clone(); async move { let mut last = 0; let mut done = None; diff --git a/yazi-sftp/src/fs/file.rs b/yazi-sftp/src/fs/file.rs index 14e91151..dd075b86 100644 --- a/yazi-sftp/src/fs/file.rs +++ b/yazi-sftp/src/fs/file.rs @@ -100,11 +100,11 @@ impl AsyncSeek for File { self.seek_rx = Some(match position { SeekFrom::Start(n) => SeekState::NonBlocking(n), - SeekFrom::Current(n) => { - self.cursor.checked_add_signed(n).map(SeekState::NonBlocking).ok_or_else(|| { - io::Error::other("seeking to a negative position or overflowed position") - })? - } + SeekFrom::Current(n) => self + .cursor + .checked_add_signed(n) + .map(SeekState::NonBlocking) + .ok_or_else(|| io::Error::other("seeking to a negative or overflowed position"))?, SeekFrom::End(n) => SeekState::Blocking( n, timeout( @@ -148,7 +148,7 @@ impl AsyncSeek for File { Ready( size .checked_add_signed(*n) - .ok_or_else(|| io::Error::other("seeking to a negative position or overflowed position")), + .ok_or_else(|| io::Error::other("seeking to a negative or overflowed position")), ) }