diff --git a/src/cert.rs b/src/cert.rs index 277b47c..f7a6c90 100644 --- a/src/cert.rs +++ b/src/cert.rs @@ -70,7 +70,7 @@ impl BIMICertificate { chain: chain_stack, not_before, not_after, - key_usages: key_usages.unwrap_or(vec![]), + key_usages: key_usages.unwrap_or_default(), }; Ok(identity) diff --git a/src/x509_helpers.rs b/src/x509_helpers.rs index 5282df7..155e91c 100644 --- a/src/x509_helpers.rs +++ b/src/x509_helpers.rs @@ -153,7 +153,7 @@ pub fn x509_bimi_get_ext(cert: &X509) -> Option> { } let len = openssl_ffi::ASN1_STRING_length(obj_data as *mut _); - let slice = slice::from_raw_parts(ptr as *const u8, len as usize); + let slice = slice::from_raw_parts(ptr, len as usize); Some(slice.to_vec()) }