From 9c2fdd95c6a4f5bfac9042ced801574785ebb48f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:54:03 +0000 Subject: [PATCH] main logging --- src/main.rs | 7 +++++-- src/sharry/file/uploading.rs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2701bcd..a8fbdc2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,8 +41,11 @@ fn main() { error!("error: {e:?}"); file = upl; } - ChunkState::Finished => break, - }; + ChunkState::Finished(path) => { + info!("Finished {:?}!", path.display()); + break; + } + } debug!("file: {file:?}"); } diff --git a/src/sharry/file/uploading.rs b/src/sharry/file/uploading.rs index e53e236..eebd8b1 100644 --- a/src/sharry/file/uploading.rs +++ b/src/sharry/file/uploading.rs @@ -32,7 +32,7 @@ pub enum UploadError { pub enum ChunkState { Ok(FileUploading), Err(FileUploading, UploadError), - Finished, + Finished(PathBuf), } impl FileUploading { @@ -86,7 +86,7 @@ impl FileUploading { self.offset = res_offset; if self.offset == self.size { - return ChunkState::Finished; + return ChunkState::Finished(self.path); } ChunkState::Ok(self)