Skip to content

Commit

Permalink
Clarify logic for environment path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Sep 9, 2024
1 parent 44b0e10 commit 77b9f37
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ use macos as platform;
///
/// [c_rehash]: https://www.openssl.org/docs/manmaster/man1/c_rehash.html
pub fn load_native_certs() -> CertificateResult {
match EnvironmentPaths::from_env().load() {
out if !out.certs.is_empty() || !out.errors.is_empty() => out,
_ => platform::load_native_certs(),
let paths = EnvironmentPaths::from_env();
match (&paths.dir, &paths.file) {
(Some(_), _) | (_, Some(_)) => paths.load(),
(None, None) => platform::load_native_certs(),
}
}

Expand Down

0 comments on commit 77b9f37

Please sign in to comment.