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/src | |
| 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/src')
| -rw-r--r-- | openssl-sys/src/lib.rs | 7 |
1 files changed, 4 insertions, 3 deletions
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); |