diff options
Diffstat (limited to 'src/api/s3/put.rs')
-rw-r--r-- | src/api/s3/put.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/s3/put.rs b/src/api/s3/put.rs index c4df7561..606facc4 100644 --- a/src/api/s3/put.rs +++ b/src/api/s3/put.rs @@ -86,7 +86,7 @@ pub(crate) async fn save_stream<S: Stream<Item = Result<Bytes, Error>> + Unpin>( // Generate identity of new version let version_uuid = gen_uuid(); - let version_timestamp = next_timestamp(&existing_object); + let version_timestamp = next_timestamp(existing_object.as_ref()); // If body is small enough, store it directly in the object table // as "inline data". We can then return immediately. @@ -529,7 +529,7 @@ pub(crate) fn get_headers(headers: &HeaderMap<HeaderValue>) -> Result<ObjectVers }) } -pub(crate) fn next_timestamp(existing_object: &Option<Object>) -> u64 { +pub(crate) fn next_timestamp(existing_object: Option<&Object>) -> u64 { existing_object .as_ref() .and_then(|obj| obj.versions().iter().map(|v| v.timestamp).max()) |