From 5e2c81c01c8e91c1fd037bb1df58926c47241dbb Mon Sep 17 00:00:00 2001 From: Faiaz Sanaulla Date: Wed, 16 Oct 2024 13:29:17 +0200 Subject: [PATCH] small tweaks --- object_store/src/aws/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/object_store/src/aws/mod.rs b/object_store/src/aws/mod.rs index 5227f8276c9e..8831a16e2877 100644 --- a/object_store/src/aws/mod.rs +++ b/object_store/src/aws/mod.rs @@ -335,9 +335,9 @@ struct UploadState { #[async_trait] impl MultipartUpload for S3MultiPartUpload { fn put_part(&mut self, data: PutPayload) -> UploadPart { - let len = data.content_length(); let idx = self.part_idx; self.part_idx += 1; + let len = data.content_length(); let state = Arc::clone(&self.state); println!( "uploading part: {}, location: {:?}, size: {}, upload_id: {}", @@ -358,7 +358,7 @@ impl MultipartUpload for S3MultiPartUpload { } async fn complete(&mut self) -> Result { - let parts = self.state.parts.finish_sorted_by(self.part_idx, sort)?; + let parts = self.state.parts.finish(self.part_idx)?; println!( "completing multipart upload, upload_id: {}, part_id: {}, location: {:?}, parts: {:?}", self.state.upload_id, self.part_idx, self.state.location, parts @@ -424,6 +424,7 @@ impl MultipartStore for AmazonS3 { } } +#[allow(unused)] // smaller parts last, everything else by index fn sort(a: &(usize, PartId), b: &(usize, PartId)) -> Ordering { if a.1.size == b.1.size {