Skip to content

Commit 6606c83

Browse files
authored
Resolve new nightly clippy warning (#12546)
Move `CertBag` into a `Box` because it is significantly larger than the other enum variants
1 parent b00cca1 commit 6606c83

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/rust/cryptography-x509/src/pkcs12.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub enum AttributeSet<'a> {
5555
#[derive(asn1::Asn1DefinedByWrite)]
5656
pub enum BagValue<'a> {
5757
#[defined_by(CERT_BAG_OID)]
58-
CertBag(CertBag<'a>),
58+
CertBag(Box<CertBag<'a>>),
5959

6060
#[defined_by(KEY_BAG_OID)]
6161
KeyBag(asn1::Tlv<'a>),

src/rust/src/pkcs12.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,14 @@ fn cert_to_bag<'a>(
285285
) -> CryptographyResult<cryptography_x509::pkcs12::SafeBag<'a>> {
286286
Ok(cryptography_x509::pkcs12::SafeBag {
287287
_bag_id: asn1::DefinedByMarker::marker(),
288-
bag_value: asn1::Explicit::new(cryptography_x509::pkcs12::BagValue::CertBag(
288+
bag_value: asn1::Explicit::new(cryptography_x509::pkcs12::BagValue::CertBag(Box::new(
289289
cryptography_x509::pkcs12::CertBag {
290290
_cert_id: asn1::DefinedByMarker::marker(),
291291
cert_value: asn1::Explicit::new(cryptography_x509::pkcs12::CertType::X509(
292292
asn1::OctetStringEncoded::new(cert.raw.borrow_dependent().clone()),
293293
)),
294294
},
295-
)),
295+
))),
296296
attributes: pkcs12_attributes(friendly_name, local_key_id)?,
297297
})
298298
}

0 commit comments

Comments
 (0)