Skip to content

Commit

Permalink
fix: fix code format & add missing #[test] attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktea1105 committed Dec 19, 2024
1 parent 26bf376 commit f3dbae7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rcgen/src/certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ impl Certificate {
/// restore from DER encoded format.
#[cfg(feature = "x509-parser")]
pub fn from_der(der: &CertificateDer<'_>) -> Result<Self, Error> {
let (_remainder, x509) = x509_parser::parse_x509_certificate(der)
.or(Err(Error::CouldNotParseCertificate))?;
let (_remainder, x509) =
x509_parser::parse_x509_certificate(der).or(Err(Error::CouldNotParseCertificate))?;
let subject_public_key_info = x509.subject_pki.raw.to_vec();
let params = CertificateParams::from_ca_cert_der(der)?;

Expand Down Expand Up @@ -1374,6 +1374,7 @@ mod tests {
}

#[cfg(feature = "x509-parser")]
#[test]
fn test_certificate_from_der() {
for alg in [
&crate::PKCS_ED25519,
Expand All @@ -1397,6 +1398,7 @@ mod tests {
}

#[cfg(all(feature = "pem", feature = "x509-parser"))]
#[test]
fn test_certificate_from_pem() {
for alg in [
&crate::PKCS_ED25519,
Expand Down

0 comments on commit f3dbae7

Please sign in to comment.