Fix clippy warnings

This commit is contained in:
2026-01-26 16:44:01 +00:00
parent 08eea07cfe
commit 2f86b4852a

View File

@@ -123,7 +123,7 @@ async fn patch_blob(Path((name, uuid)): Path<(String, String)>, body: Bytes) ->
// Append data to the upload session and get total size // Append data to the upload session and get total size
let total_size = { let total_size = {
let mut sessions = UPLOAD_SESSIONS.write(); let mut sessions = UPLOAD_SESSIONS.write();
let session = sessions.entry(uuid.clone()).or_insert_with(Vec::new); let session = sessions.entry(uuid.clone()).or_default();
session.extend_from_slice(&body); session.extend_from_slice(&body);
session.len() session.len()
}; };
@@ -262,13 +262,13 @@ async fn put_manifest(
// Store by tag/reference // Store by tag/reference
let key = format!("docker/{}/manifests/{}.json", name, reference); let key = format!("docker/{}/manifests/{}.json", name, reference);
if let Err(_) = state.storage.put(&key, &body).await { if state.storage.put(&key, &body).await.is_err() {
return StatusCode::INTERNAL_SERVER_ERROR.into_response(); return StatusCode::INTERNAL_SERVER_ERROR.into_response();
} }
// Also store by digest for direct digest lookups // Also store by digest for direct digest lookups
let digest_key = format!("docker/{}/manifests/{}.json", name, digest); let digest_key = format!("docker/{}/manifests/{}.json", name, digest);
if let Err(_) = state.storage.put(&digest_key, &body).await { if state.storage.put(&digest_key, &body).await.is_err() {
return StatusCode::INTERNAL_SERVER_ERROR.into_response(); return StatusCode::INTERNAL_SERVER_ERROR.into_response();
} }