From bbdefff07cf588ad5f848bec9031f4e51cc47c41 Mon Sep 17 00:00:00 2001 From: DevITWay Date: Fri, 30 Jan 2026 23:29:34 +0000 Subject: [PATCH] style: fix formatting --- nora-registry/src/registry/docker.rs | 30 ++++++++++++++++++++++------ nora-registry/src/storage/mod.rs | 4 +++- nora-registry/src/storage/s3.rs | 7 +++---- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/nora-registry/src/registry/docker.rs b/nora-registry/src/registry/docker.rs index 91ef4a3..2e4e5b8 100644 --- a/nora-registry/src/registry/docker.rs +++ b/nora-registry/src/registry/docker.rs @@ -50,18 +50,36 @@ pub fn routes() -> Router> { // Single-segment name routes (e.g., /v2/alpine/...) .route("/v2/{name}/blobs/{digest}", head(check_blob)) .route("/v2/{name}/blobs/{digest}", get(download_blob)) - .route("/v2/{name}/blobs/uploads/", axum::routing::post(start_upload)) - .route("/v2/{name}/blobs/uploads/{uuid}", patch(patch_blob).put(upload_blob)) + .route( + "/v2/{name}/blobs/uploads/", + axum::routing::post(start_upload), + ) + .route( + "/v2/{name}/blobs/uploads/{uuid}", + patch(patch_blob).put(upload_blob), + ) .route("/v2/{name}/manifests/{reference}", get(get_manifest)) .route("/v2/{name}/manifests/{reference}", put(put_manifest)) .route("/v2/{name}/tags/list", get(list_tags)) // Two-segment name routes (e.g., /v2/library/alpine/...) .route("/v2/{ns}/{name}/blobs/{digest}", head(check_blob_ns)) .route("/v2/{ns}/{name}/blobs/{digest}", get(download_blob_ns)) - .route("/v2/{ns}/{name}/blobs/uploads/", axum::routing::post(start_upload_ns)) - .route("/v2/{ns}/{name}/blobs/uploads/{uuid}", patch(patch_blob_ns).put(upload_blob_ns)) - .route("/v2/{ns}/{name}/manifests/{reference}", get(get_manifest_ns)) - .route("/v2/{ns}/{name}/manifests/{reference}", put(put_manifest_ns)) + .route( + "/v2/{ns}/{name}/blobs/uploads/", + axum::routing::post(start_upload_ns), + ) + .route( + "/v2/{ns}/{name}/blobs/uploads/{uuid}", + patch(patch_blob_ns).put(upload_blob_ns), + ) + .route( + "/v2/{ns}/{name}/manifests/{reference}", + get(get_manifest_ns), + ) + .route( + "/v2/{ns}/{name}/manifests/{reference}", + put(put_manifest_ns), + ) .route("/v2/{ns}/{name}/tags/list", get(list_tags_ns)) } diff --git a/nora-registry/src/storage/mod.rs b/nora-registry/src/storage/mod.rs index 6a6145e..2096591 100644 --- a/nora-registry/src/storage/mod.rs +++ b/nora-registry/src/storage/mod.rs @@ -67,7 +67,9 @@ impl Storage { secret_key: Option<&str>, ) -> Self { Self { - inner: Arc::new(S3Storage::new(s3_url, bucket, region, access_key, secret_key)), + inner: Arc::new(S3Storage::new( + s3_url, bucket, region, access_key, secret_key, + )), } } diff --git a/nora-registry/src/storage/s3.rs b/nora-registry/src/storage/s3.rs index f99a6d7..4bf3e13 100644 --- a/nora-registry/src/storage/s3.rs +++ b/nora-registry/src/storage/s3.rs @@ -122,7 +122,8 @@ impl S3Storage { .header("x-amz-date", ×tamp) .header("x-amz-content-sha256", &payload_hash); - if let Some(auth) = self.sign_request(method.as_str(), key, &payload_hash, ×tamp, &date) + if let Some(auth) = + self.sign_request(method.as_str(), key, &payload_hash, ×tamp, &date) { request = request.header("Authorization", auth); } @@ -186,9 +187,7 @@ impl StorageBackend for S3Storage { } async fn get(&self, key: &str) -> Result { - let response = self - .signed_request(reqwest::Method::GET, key, None) - .await?; + let response = self.signed_request(reqwest::Method::GET, key, None).await?; if response.status().is_success() { response