diff --git a/openssl-sys/src/handwritten/store.rs b/openssl-sys/src/handwritten/store.rs index 1bc314d3df..2739714724 100644 --- a/openssl-sys/src/handwritten/store.rs +++ b/openssl-sys/src/handwritten/store.rs @@ -1,4 +1,3 @@ - use super::super::*; use libc::*; diff --git a/openssl/src/store.rs b/openssl/src/store.rs index 378fd747d9..f38e4cf434 100644 --- a/openssl/src/store.rs +++ b/openssl/src/store.rs @@ -1,4 +1,3 @@ - use foreign_types::ForeignType; use std::ffi::CString; @@ -8,7 +7,7 @@ use crate::cvt_p; use crate::error::ErrorStack; use crate::pkey::{PKey, Private}; -pub struct Store (*mut ffi::OSSL_STORE_CTX); +pub struct Store(*mut ffi::OSSL_STORE_CTX); impl Drop for Store { fn drop(&mut self) { @@ -19,32 +18,30 @@ impl Drop for Store { } impl Store { - pub fn private_key_from_uri( - uri: &str - ) -> Result>, ErrorStack> { + pub fn private_key_from_uri(uri: &str) -> Result>, ErrorStack> { let uri = CString::new(uri).unwrap(); unsafe { - let store = - cvt_p(ffi::OSSL_STORE_open(uri.as_ptr(), ptr::null(), ptr::null(), ptr::null(), ptr::null())) + let store = cvt_p(ffi::OSSL_STORE_open( + uri.as_ptr(), + ptr::null(), + ptr::null(), + ptr::null(), + ptr::null(), + )) .map(|p| Store(p))?; - - let mut store_info = cvt_p( - ffi::OSSL_STORE_load(store.0) - )?; + let mut store_info = cvt_p(ffi::OSSL_STORE_load(store.0))?; while store_info != ptr::null_mut() { let type_ = ffi::OSSL_STORE_INFO_get_type(store_info); if type_ == ffi::OSSL_STORE_INFO_PKEY { let pkey_ptr = cvt_p(ffi::OSSL_STORE_INFO_get1_PKEY(store_info))?; - return Ok(Some(PKey::from_ptr(pkey_ptr))) + return Ok(Some(PKey::from_ptr(pkey_ptr))); } ffi::OSSL_STORE_INFO_free(store_info); - store_info = cvt_p( - ffi::OSSL_STORE_load(store.0) - )?; + store_info = cvt_p(ffi::OSSL_STORE_load(store.0))?; } // error? @@ -52,4 +49,3 @@ impl Store { } } } -