@@ -534,7 +534,7 @@ impl ToS3Request for PutObject {
534
534
535
535
// region: put-object-content
536
536
537
- /// PutObjectContent takes a `ObjectContent` stream and uploads it to MinIO/S3.
537
+ /// PutObjectContent takes an `ObjectContent` stream and uploads it to MinIO/S3.
538
538
///
539
539
/// It is a higher level API and handles multipart uploads transparently.
540
540
#[ derive( Default ) ]
@@ -768,7 +768,7 @@ impl PutObjectContent {
768
768
assert ! ( buffer_size <= part_size, "{buffer_size} <= {part_size}" , ) ;
769
769
770
770
if ( buffer_size == 0 ) && ( part_number > 1 ) {
771
- // We are done as we uploaded at least 1 part and we have reached the end of the stream.
771
+ // We are done as we uploaded at least 1 part, and we have reached the end of the stream.
772
772
break ;
773
773
}
774
774
@@ -812,7 +812,7 @@ impl PutObjectContent {
812
812
size : buffer_size,
813
813
} ) ;
814
814
815
- // Finally check if we are done.
815
+ // Finally, check if we are done.
816
816
if buffer_size < part_size {
817
817
done = true ;
818
818
}
@@ -955,7 +955,7 @@ pub fn calc_part_info(
955
955
}
956
956
957
957
match ( object_size, part_size) {
958
- // If object size is unknown, part size must be provided.
958
+ // If the object size is unknown, the part size must be provided.
959
959
( Size :: Unknown , Size :: Unknown ) => Err ( ValidationErr :: MissingPartSize ) ,
960
960
961
961
// If object size is unknown, and part size is known, the number of
@@ -965,8 +965,7 @@ pub fn calc_part_info(
965
965
// If object size is known, and part size is unknown, calculate part
966
966
// size.
967
967
( Size :: Known ( object_size) , Size :: Unknown ) => {
968
- // 1. Calculate the minimum part size (i.e. assuming part count is
969
- // maximum).
968
+ // 1. Calculate the minimum part size (i.e., assuming part count is the maximum).
970
969
let mut psize: u64 = ( object_size as f64 / MAX_MULTIPART_COUNT as f64 ) . ceil ( ) as u64 ;
971
970
972
971
// 2. Round up to the nearest multiple of MIN_PART_SIZE.
@@ -1024,14 +1023,14 @@ mod tests {
1024
1023
}
1025
1024
}
1026
1025
}
1027
- if let Size :: Known ( v) = object_size {
1028
- if v > MAX_OBJECT_SIZE {
1026
+ if let Size :: Known ( v) = object_size
1027
+ && v > MAX_OBJECT_SIZE {
1029
1028
return match res {
1030
1029
Err ( ValidationErr :: InvalidObjectSize ( v_err) ) => v == v_err,
1031
1030
_ => false ,
1032
1031
}
1033
1032
}
1034
- }
1033
+
1035
1034
1036
1035
// Validate the calculation of part size and part count.
1037
1036
match ( object_size, part_size, res) {
0 commit comments