Optimized code for fsentry

This commit is contained in:
ChristianVisintin
2020-12-12 16:32:21 +01:00
parent f73e43304e
commit 57e83a63dd
5 changed files with 10 additions and 40 deletions

View File

@@ -461,10 +461,7 @@ impl FileTransfer for SftpFileTransfer {
// Resolve destination path
let abs_dst: PathBuf = self.get_abs_path(dst);
// Get abs path of entry
let abs_src: PathBuf = match file {
FsEntry::Directory(dir) => dir.abs_path.clone(),
FsEntry::File(file) => file.abs_path.clone(),
};
let abs_src: PathBuf = file.get_abs_path();
match sftp.rename(abs_src.as_path(), abs_dst.as_path(), None) {
Ok(_) => Ok(()),
Err(err) => Err(FileTransferError::new_ex(