From 96a5ceae6d61e945b6e38242f68fd83d398fcc70 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Wed, 28 Jan 2026 21:18:11 -0800 Subject: [PATCH] Appease clippy by making the error type smaller It used to be over 200 bytes which was triggering a Clippy lint. These variants are the ones it complained about, so I boxed them. --- apple-codesign/src/error.rs | 16 +++++++++++++--- apple-codesign/src/notarization.rs | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/apple-codesign/src/error.rs b/apple-codesign/src/error.rs index df2290909..9361890c0 100644 --- a/apple-codesign/src/error.rs +++ b/apple-codesign/src/error.rs @@ -381,8 +381,10 @@ pub enum AppleCodesignError { #[cfg(feature = "notarize")] #[error("s3 upload error: {0}")] AwsS3PutObject( - aws_smithy_types::error::display::DisplayErrorContext< - aws_sdk_s3::error::SdkError, + Box< + aws_smithy_types::error::display::DisplayErrorContext< + aws_sdk_s3::error::SdkError, + >, >, ), @@ -396,11 +398,19 @@ pub enum AppleCodesignError { Plist(#[from] plist::Error), #[error("config error: {0:?}")] - Figment(#[from] figment::Error), + Figment(Box), #[error("environment constraints: {0}")] EnvironmentConstraint(String), } +/// Can't use `#[from]` because we have to box this; we are boxing it because it's +/// >200 bytes and clippy doesn't like it. +impl From for AppleCodesignError { + fn from(err: figment::Error) -> Self { + Self::Figment(Box::new(err)) + } +} + /// Result type for this library. pub type Result = std::result::Result; diff --git a/apple-codesign/src/notarization.rs b/apple-codesign/src/notarization.rs index 276921531..4685fc140 100644 --- a/apple-codesign/src/notarization.rs +++ b/apple-codesign/src/notarization.rs @@ -336,7 +336,7 @@ impl Notarizer { rt.block_on(fut).map_err(|e| { AppleCodesignError::AwsS3PutObject( - aws_smithy_types::error::display::DisplayErrorContext(e), + aws_smithy_types::error::display::DisplayErrorContext(e).into(), ) })?;