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")), ) }