From 91637c5425a7147f0550deaacc89eeb945d0a227 Mon Sep 17 00:00:00 2001 From: Jon Schneck Date: Tue, 25 Aug 2026 07:30:29 -0400 Subject: [PATCH] registry: allow result_large_err on the axum-idiom error path clippy 1.98 (current CI stable) grew result_large_err and fires on stream_into's Result<(), Response> - main is red for every PR. The Err IS a full OCI error Response the caller returns verbatim, which is the axum idiom; the fn runs once per upload request, so boxing would trade call-site ergonomics for bytes that do not matter. Targeted allow with the rationale in the doc comment. --- src/utils/container_dev/registry.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/container_dev/registry.rs b/src/utils/container_dev/registry.rs index b8dea12f..4cfafa68 100644 --- a/src/utils/container_dev/registry.rs +++ b/src/utils/container_dev/registry.rs @@ -421,6 +421,14 @@ async fn post_route( } /// Drain `body` into `upload`, mapping a transport error to an OCI response. +/// +/// `Err` is a full axum `Response` on purpose: every error here is an OCI +/// error payload the caller returns verbatim, which is the axum idiom. +/// clippy 1.98's `result_large_err` (>=128 bytes) would rather see it boxed, +/// but this fn is called once per upload request, not in a loop - the +/// indirection would cost call-site `?` ergonomics to save bytes that do +/// not matter here. +#[allow(clippy::result_large_err)] async fn stream_into(body: Body, upload: &mut BlobUpload) -> Result<(), Response> { let mut stream = body.into_data_stream(); while let Some(chunk) = stream.next().await {