diff options
| author | Steven Fackler <[email protected]> | 2015-02-05 21:04:18 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-02-05 21:04:18 -0800 |
| commit | d06f226b3f7fd3517ea2299abebd7df031c1a428 (patch) | |
| tree | 460de4005e2f5833766ee3e872e7d5c1ae6fc79f | |
| parent | Release v0.3.1 (diff) | |
| download | rust-openssl-d06f226b3f7fd3517ea2299abebd7df031c1a428.tar.xz rust-openssl-d06f226b3f7fd3517ea2299abebd7df031c1a428.zip | |
Fix deprecation warnings in openssl-sys
| -rw-r--r-- | openssl-sys/build.rs | 13 | ||||
| -rw-r--r-- | openssl-sys/src/lib.rs | 2 | ||||
| -rw-r--r-- | openssl-sys/src/probe.rs | 10 |
3 files changed, 13 insertions, 12 deletions
diff --git a/openssl-sys/build.rs b/openssl-sys/build.rs index a5d3f2d1..a7b39e84 100644 --- a/openssl-sys/build.rs +++ b/openssl-sys/build.rs @@ -1,11 +1,11 @@ -#![feature(core, collections, os)] +#![feature(core, collections, env)] extern crate "pkg-config" as pkg_config; -use std::os; +use std::env; fn main() { - let target = os::getenv("TARGET").unwrap(); + let target = env::var_string("TARGET").unwrap(); let is_android = target.find_str("android").is_some(); // Without hackory, pkg-config will only look for host libraries. @@ -32,9 +32,10 @@ fn main() { } if is_android { - let path = os::getenv("OPENSSL_PATH").expect("Android does not provide openssl libraries, please \ - build them yourselves (instructions in the README) \ - and provide their location through $OPENSSL_PATH."); + let path = env::var_string("OPENSSL_PATH").ok() + .expect("Android does not provide openssl libraries, please build them yourselves \ + (instructions in the README) and provide their location through \ + $OPENSSL_PATH."); flags.push_str(format!(" -L {}", path).as_slice()); } diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 84bd004b..fd16792b 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -1,6 +1,6 @@ #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] #![allow(dead_code)] -#![feature(core, io, libc, os, path, std_misc)] +#![feature(core, io, libc, path, std_misc, env)] extern crate libc; diff --git a/openssl-sys/src/probe.rs b/openssl-sys/src/probe.rs index 1615f73a..7896b3e9 100644 --- a/openssl-sys/src/probe.rs +++ b/openssl-sys/src/probe.rs @@ -1,4 +1,4 @@ -use std::os; +use std::env; use std::old_io::fs::PathExtensions; pub struct ProbeResult { @@ -41,17 +41,17 @@ pub fn init_ssl_cert_env_vars() { fn put(var: &str, path: Path) { // Don't stomp over what anyone else has set - match os::getenv(var) { + match env::var(var) { Some(..) => {} - None => os::setenv(var, path), + None => env::set_var(var, &path), } } } pub fn probe() -> ProbeResult { let mut result = ProbeResult { - cert_file: os::getenv("SSL_CERT_FILE").map(Path::new), - cert_dir: os::getenv("SSL_CERT_DIR").map(Path::new), + cert_file: env::var_string("SSL_CERT_FILE").ok().map(Path::new), + cert_dir: env::var_string("SSL_CERT_DIR").ok().map(Path::new), }; for certs_dir in find_certs_dirs().iter() { // cert.pem looks to be an openssl 1.0.1 thing, while |