diff options
| author | Chris Cole <[email protected]> | 2015-01-03 19:31:14 -0500 |
|---|---|---|
| committer | Chris Cole <[email protected]> | 2015-01-03 19:31:14 -0500 |
| commit | fde7fbd03b0a92c2bf515c8f1fd3609b8b8745e6 (patch) | |
| tree | d2d40563122545c4e24ac7ac387145e5e0886bf4 /openssl-sys | |
| parent | Merge branch 'master' of https://github.com/cjcole/rust-openssl (diff) | |
| parent | Release v0.2.11 (diff) | |
| download | rust-openssl-fde7fbd03b0a92c2bf515c8f1fd3609b8b8745e6.tar.xz rust-openssl-fde7fbd03b0a92c2bf515c8f1fd3609b8b8745e6.zip | |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'openssl-sys')
| -rw-r--r-- | openssl-sys/Cargo.toml | 2 | ||||
| -rw-r--r-- | openssl-sys/src/lib.rs | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/openssl-sys/Cargo.toml b/openssl-sys/Cargo.toml index 24912cbc..de18ab54 100644 --- a/openssl-sys/Cargo.toml +++ b/openssl-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openssl-sys" -version = "0.2.10" +version = "0.2.11" authors = ["Alex Crichton <[email protected]>", "Steven Fackler <[email protected]>"] license = "MIT" diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 7471616f..fb1ecb78 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -211,14 +211,15 @@ pub fn init() { static mut INIT: Once = ONCE_INIT; unsafe { - INIT.doit(|| { + INIT.call_once(|| { SSL_library_init(); SSL_load_error_strings(); let num_locks = CRYPTO_num_locks(); - let mutexes = box Vec::from_fn(num_locks as uint, |_| MUTEX_INIT); + let mutexes = box range(0, num_locks).map(|_| MUTEX_INIT).collect::<Vec<_>>(); MUTEXES = mem::transmute(mutexes); - let guards: Box<Vec<Option<MutexGuard<()>>>> = box Vec::from_fn(num_locks as uint, |_| None); + let guards: Box<Vec<Option<MutexGuard<()>>>> = + box range(0, num_locks).map(|_| None).collect(); GUARDS = mem::transmute(guards); CRYPTO_set_locking_callback(locking_function); |