diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-02-08 17:01:22 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-02-08 17:01:22 +0100 |
| commit | 6f661a08c8420a2d6f925b8d1f0676a33a4ccdef (patch) | |
| tree | 253eff5b22e4f344ff848024ea61ac23ca530931 | |
| parent | eab259139192e8f648123f6b5cce2fe067dc3504 (diff) | |
| download | mullvadvpn-6f661a08c8420a2d6f925b8d1f0676a33a4ccdef.tar.xz mullvadvpn-6f661a08c8420a2d6f925b8d1f0676a33a4ccdef.zip | |
Create Errors with into() instead of Error::from
| -rw-r--r-- | src/net.rs | 2 | ||||
| -rw-r--r-- | talpid_openvpn_plugin/src/ffi/parse.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/net.rs b/src/net.rs index 0646a6fd31..cfb902b6b6 100644 --- a/src/net.rs +++ b/src/net.rs @@ -61,7 +61,7 @@ impl RemoteAddr { })?; if address.is_empty() || address.contains(':') { let msg = format!("Invalid IP or domain: \"{}\"", address); - return Err(Error::from(ErrorKind::AddrParse(msg))); + return Err(ErrorKind::AddrParse(msg).into()); } Ok(RemoteAddr::Domain(address.to_owned(), port)) } diff --git a/talpid_openvpn_plugin/src/ffi/parse.rs b/talpid_openvpn_plugin/src/ffi/parse.rs index db26335d27..d694f1efb7 100644 --- a/talpid_openvpn_plugin/src/ffi/parse.rs +++ b/talpid_openvpn_plugin/src/ffi/parse.rs @@ -28,7 +28,7 @@ error_chain!{ /// terminated. Likewise, if any string pointed to is not properly null-terminated it may crash. pub unsafe fn string_array(mut ptr: *const *const c_char) -> Result<Vec<String>> { if ptr.is_null() { - Err(Error::from(ErrorKind::Null)) + Err(ErrorKind::Null.into()) } else { let mut strings = Vec::new(); while !(*ptr).is_null() { |
