diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-05-18 11:53:50 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-05-18 14:02:11 +0200 |
| commit | a29bfadfc6ee7ce4e32725fb07cda61ac9353915 (patch) | |
| tree | e1665fe2a1175416b2ae99a3c3afe2c7751385d0 /talpid_ipc/src | |
| parent | c6c366ca506b37e9cc08adf0914beb4acb31642a (diff) | |
| download | mullvadvpn-a29bfadfc6ee7ce4e32725fb07cda61ac9353915.tar.xz mullvadvpn-a29bfadfc6ee7ce4e32725fb07cda61ac9353915.zip | |
Upgrade serde deps to 1.0
Diffstat (limited to 'talpid_ipc/src')
| -rw-r--r-- | talpid_ipc/src/nop_ipc.rs | 2 | ||||
| -rw-r--r-- | talpid_ipc/src/zmq_ipc.rs | 8 |
2 files changed, 5 insertions, 5 deletions
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) } |
