Skip to content

Commit

Permalink
Rewrite if let as match
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Jul 3, 2024
1 parent e0b388a commit e08693c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ use pki_types::CertificateDer;
///
/// [c_rehash]: https://www.openssl.org/docs/manmaster/man1/c_rehash.html
pub fn load_native_certs() -> Result<Vec<CertificateDer<'static>>, Error> {
if let Some(certs) = CertPaths::from_env().load()? {
return Ok(certs);
};
platform::load_native_certs()
match CertPaths::from_env().load()? {
Some(certs) => Ok(certs),
None => platform::load_native_certs(),
}
}

/// Certificate paths from `SSL_CERT_FILE` and/or `SSL_CERT_DIR`.
Expand Down

0 comments on commit e08693c

Please sign in to comment.