diff options
| -rw-r--r-- | Cargo.lock | 7 | ||||
| -rw-r--r-- | talpid_openvpn_plugin/Cargo.toml | 1 | ||||
| -rw-r--r-- | talpid_openvpn_plugin/src/ffi/consts.rs | 2 | ||||
| -rw-r--r-- | talpid_openvpn_plugin/src/ffi/parse.rs | 4 | ||||
| -rw-r--r-- | talpid_openvpn_plugin/src/ffi/structs.rs | 6 | ||||
| -rw-r--r-- | talpid_openvpn_plugin/src/lib.rs | 5 |
6 files changed, 7 insertions, 18 deletions
diff --git a/Cargo.lock b/Cargo.lock index 16382a5c4f..a7edc49b38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,7 +5,6 @@ dependencies = [ "assert_matches 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -129,11 +128,6 @@ dependencies = [ ] [[package]] -name = "lazy_static" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] name = "libc" version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -333,7 +327,6 @@ dependencies = [ "checksum error-chain 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6930e04918388a9a2e41d518c25cf679ccafe26733fb4127dbf21993f2575d46" "checksum gcc 0.3.42 (registry+https://github.com/rust-lang/crates.io-index)" = "291055c78f59ca3d84c99026c9501c469413d386bb46be1e1cf1d285cd1db3b0" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6abe0ee2e758cd6bc8a2cd56726359007748fbf4128da998b65d0b70f881e19b" "checksum libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "684f330624d8c3784fb9558ca46c4ce488073a8d22450415c5eb4f4cfb0d11b5" "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" diff --git a/talpid_openvpn_plugin/Cargo.toml b/talpid_openvpn_plugin/Cargo.toml index 44fd3e0112..79c0f387cb 100644 --- a/talpid_openvpn_plugin/Cargo.toml +++ b/talpid_openvpn_plugin/Cargo.toml @@ -8,7 +8,6 @@ description = "OpenVPN shared library plugin for relaying OpenVPN events to talp crate-type = ["dylib"] [dependencies] -lazy_static = "0.2" error-chain = "0.8" log = "0.3" env_logger = "0.4" diff --git a/talpid_openvpn_plugin/src/ffi/consts.rs b/talpid_openvpn_plugin/src/ffi/consts.rs index c7cddfd279..cf5490afbc 100644 --- a/talpid_openvpn_plugin/src/ffi/consts.rs +++ b/talpid_openvpn_plugin/src/ffi/consts.rs @@ -12,7 +12,7 @@ error_chain!{ } } -/// Enum whose variants correspond to the OPENVPN_PLUGIN_* event constants. +/// Enum whose variants correspond to the `OPENVPN_PLUGIN_*` event constants. #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum OpenVpnPluginEvent { Up = 0, diff --git a/talpid_openvpn_plugin/src/ffi/parse.rs b/talpid_openvpn_plugin/src/ffi/parse.rs index d694f1efb7..096e3ada55 100644 --- a/talpid_openvpn_plugin/src/ffi/parse.rs +++ b/talpid_openvpn_plugin/src/ffi/parse.rs @@ -55,9 +55,9 @@ pub unsafe fn string_array(mut ptr: *const *const c_char) -> Result<Vec<String>> pub unsafe fn env(envptr: *const *const c_char) -> Result<HashMap<String, String>> { let mut map = HashMap::new(); for string in string_array(envptr)? { - let mut iter = string.splitn(2, "="); + let mut iter = string.splitn(2, '='); let key = iter.next().unwrap(); - let value = iter.next().ok_or(Error::from(ErrorKind::NoEqual(string.clone())))?; + let value = iter.next().ok_or_else(|| Error::from(ErrorKind::NoEqual(string.clone())))?; map.insert(key.to_owned(), value.to_owned()); } Ok(map) diff --git a/talpid_openvpn_plugin/src/ffi/structs.rs b/talpid_openvpn_plugin/src/ffi/structs.rs index 325f312974..ba5bc2b343 100644 --- a/talpid_openvpn_plugin/src/ffi/structs.rs +++ b/talpid_openvpn_plugin/src/ffi/structs.rs @@ -17,9 +17,9 @@ pub struct openvpn_plugin_args_open_in { #[allow(dead_code)] #[repr(C)] enum ovpnSSLAPI { - SSLAPI_NONE, - SSLAPI_OPENSSL, - SSLAPI_MBEDTLS, + None, + OpenSsl, + MbedTls, } /// Struct used for returning values from `openvpn_plugin_open_v3` to OpenVPN. diff --git a/talpid_openvpn_plugin/src/lib.rs b/talpid_openvpn_plugin/src/lib.rs index 782fa59a6f..4eb2a0f336 100644 --- a/talpid_openvpn_plugin/src/lib.rs +++ b/talpid_openvpn_plugin/src/lib.rs @@ -1,7 +1,4 @@ #[macro_use] -extern crate lazy_static; - -#[macro_use] extern crate error_chain; #[macro_use] @@ -88,7 +85,7 @@ pub extern "C" fn openvpn_plugin_close_v1(handle: *const c_void) { } -/// Called by OpenVPN for each OPENVPN_PLUGIN_* event that it registered for in +/// Called by OpenVPN for each `OPENVPN_PLUGIN_*` event that it registered for in /// `openvpn_plugin_open_v3` #[no_mangle] pub extern "C" fn openvpn_plugin_func_v3(_version: c_int, |
