diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-06-09 20:44:55 -0400 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-06-09 20:44:55 -0400 |
commit | 6439ea091be28403bfefc67802c9920e37bfdd9d (patch) | |
tree | 4d76e439acfcb56ea5f2deada66f270dc8c46b62 /src/io | |
parent | fc94b9410456e6fe421eadf9c406dbebe9414753 (diff) |
fix cut jobs not correctly reporting file transfer size
Diffstat (limited to 'src/io')
-rw-r--r-- | src/io/io_worker.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/io/io_worker.rs b/src/io/io_worker.rs index ae375a6..63d0c6f 100644 --- a/src/io/io_worker.rs +++ b/src/io/io_worker.rs @@ -236,6 +236,12 @@ pub fn recursive_cut( let file_type = metadata.file_type(); match fs::rename(src, dest_buf.as_path()) { + Ok(_) => { + let bytes_processed = progress.bytes_processed() + metadata.len(); + progress.set_bytes_processed(bytes_processed); + progress.set_files_processed(progress.files_processed() + 1); + Ok(()) + } Err(e) if e.kind() == io::ErrorKind::Other => { if file_type.is_dir() { fs::create_dir(dest_buf.as_path())?; @@ -262,9 +268,8 @@ pub fn recursive_cut( progress.set_bytes_processed(processed); progress.set_files_processed(progress.files_processed() + 1); } + Ok(()) } - Err(e) => return Err(e), - _ => {} + e => e, } - Ok(()) } |