summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2017-05-18 11:53:50 +0200
committerLinus Färnstrand <linus@mullvad.net>2017-05-18 14:02:11 +0200
commita29bfadfc6ee7ce4e32725fb07cda61ac9353915 (patch)
treee1665fe2a1175416b2ae99a3c3afe2c7751385d0
parentc6c366ca506b37e9cc08adf0914beb4acb31642a (diff)
downloadmullvadvpn-a29bfadfc6ee7ce4e32725fb07cda61ac9353915.tar.xz
mullvadvpn-a29bfadfc6ee7ce4e32725fb07cda61ac9353915.zip
Upgrade serde deps to 1.0
-rw-r--r--openvpn_ffi/Cargo.toml4
-rw-r--r--talpid_ipc/Cargo.toml4
-rw-r--r--talpid_ipc/src/nop_ipc.rs2
-rw-r--r--talpid_ipc/src/zmq_ipc.rs8
-rw-r--r--talpid_ipc/tests/zmq_integration_tests.rs2
5 files changed, 10 insertions, 10 deletions
diff --git a/openvpn_ffi/Cargo.toml b/openvpn_ffi/Cargo.toml
index 2c292fca94..062bf1f063 100644
--- a/openvpn_ffi/Cargo.toml
+++ b/openvpn_ffi/Cargo.toml
@@ -6,8 +6,8 @@ description = "Constants, enums and structs for interfacing with OpenVPN"
[dependencies]
error-chain = "0.10"
-serde = "0.9"
-serde_derive = "0.9"
+serde = "1.0"
+serde_derive = "1.0"
[dev-dependencies]
assert_matches = "1.0"
diff --git a/talpid_ipc/Cargo.toml b/talpid_ipc/Cargo.toml
index a4e15b5db8..a0b24de4a3 100644
--- a/talpid_ipc/Cargo.toml
+++ b/talpid_ipc/Cargo.toml
@@ -6,8 +6,8 @@ description = "IPC client and server for talpid"
[dependencies]
error-chain = "0.10"
-serde = "0.9"
-serde_json = "0.9"
+serde = "1.0"
+serde_json = "1.0"
log = "0.3"
jsonrpc-core = { git = "https://github.com/faern/jsonrpc", branch = "bind-zero" }
jsonrpc-ws-server = { git = "https://github.com/faern/jsonrpc", branch = "bind-zero" }
diff --git a/talpid_ipc/src/nop_ipc.rs b/talpid_ipc/src/nop_ipc.rs
index f6ead2676b..8c7a24bc63 100644
--- a/talpid_ipc/src/nop_ipc.rs
+++ b/talpid_ipc/src/nop_ipc.rs
@@ -9,7 +9,7 @@ use serde;
/// We plan on trying with ZMQ again in the future.
/// Erik, 2017-02-09
pub fn start_new_server<T, F>(_on_message: F) -> Result<IpcServerId>
- where T: serde::Deserialize + 'static,
+ where for<'de> T: serde::Deserialize<'de> + 'static,
F: FnMut(Result<T>) + Send + 'static
{
bail!(ErrorKind::CouldNotStartServer);
diff --git a/talpid_ipc/src/zmq_ipc.rs b/talpid_ipc/src/zmq_ipc.rs
index 49aad9f699..35fe5e59a9 100644
--- a/talpid_ipc/src/zmq_ipc.rs
+++ b/talpid_ipc/src/zmq_ipc.rs
@@ -16,7 +16,7 @@ use std::thread;
///
/// This function is non-blocking and thus spawns a thread where it listens to messages.
pub fn start_new_server<T, F>(on_message: F) -> Result<IpcServerId>
- where T: serde::Deserialize + 'static,
+ where for<'de> T: serde::Deserialize<'de> + 'static,
F: FnMut(Result<T>) + Send + 'static
{
for port in 5000..5010 {
@@ -40,7 +40,7 @@ fn start_zmq_server(connection_string: &str) -> zmq::Result<zmq::Socket> {
}
fn start_receive_loop<T, F>(socket: zmq::Socket, mut on_message: F) -> thread::JoinHandle<()>
- where T: serde::Deserialize + 'static,
+ where for<'de> T: serde::Deserialize<'de> + 'static,
F: FnMut(Result<T>) + Send + 'static
{
thread::spawn(
@@ -54,8 +54,8 @@ fn start_receive_loop<T, F>(socket: zmq::Socket, mut on_message: F) -> thread::J
)
}
-fn parse_message<T>(message: &[u8]) -> Result<T>
- where T: serde::Deserialize + 'static
+fn parse_message<'a, T>(message: &'a [u8]) -> Result<T>
+ where T: serde::Deserialize<'a> + 'static
{
serde_json::from_slice(message).chain_err(|| ErrorKind::ParseFailure)
}
diff --git a/talpid_ipc/tests/zmq_integration_tests.rs b/talpid_ipc/tests/zmq_integration_tests.rs
index 4bd484cf0a..db9650f7a0 100644
--- a/talpid_ipc/tests/zmq_integration_tests.rs
+++ b/talpid_ipc/tests/zmq_integration_tests.rs
@@ -24,7 +24,7 @@ mod zmq_integration_tests {
}
fn start_server<T>() -> (IpcServerId, Receiver<Result<T>>)
- where T: serde::Deserialize + Send + 'static
+ where for<'de> T: serde::Deserialize<'de> + Send + 'static
{
let (tx, rx) = mpsc::channel();