mirror of
https://github.com/openharmony/third_party_rust_openssl-probe.git
synced 2026-07-01 10:18:23 -04:00
Merge pull request #10 from timvisee/fix-use-after-move
Fix use after move error introduced in new Rust version
This commit is contained in:
+4
-4
@@ -48,20 +48,20 @@ pub fn find_certs_dirs() -> Vec<PathBuf> {
|
||||
/// variables are valid.
|
||||
pub fn init_ssl_cert_env_vars() -> bool {
|
||||
let ProbeResult { cert_file, cert_dir } = probe();
|
||||
match cert_file {
|
||||
match &cert_file {
|
||||
Some(path) => put(ENV_CERT_FILE, path),
|
||||
None => {}
|
||||
}
|
||||
match cert_dir {
|
||||
match &cert_dir {
|
||||
Some(path) => put(ENV_CERT_DIR, path),
|
||||
None => {}
|
||||
}
|
||||
|
||||
fn put(var: &str, path: PathBuf) {
|
||||
fn put(var: &str, path: &PathBuf) {
|
||||
// Don't stomp over what anyone else has set
|
||||
match env::var(var) {
|
||||
Ok(..) => {}
|
||||
Err(..) => env::set_var(var, &path),
|
||||
Err(..) => env::set_var(var, path),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user