diff options
| author | Erik Larkö <erik@mullvad.net> | 2017-03-03 09:10:03 +0800 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-03-06 13:22:36 +0100 |
| commit | 3dbbd423d0596e398d72c5207eec04c1b28c2ef7 (patch) | |
| tree | 77bd1c35a1dc2d385be1bdb9a4277c9f0625385d | |
| parent | aa65fc13728bea2d206d894c49c5d1a67a3ee1ec (diff) | |
| download | mullvadvpn-3dbbd423d0596e398d72c5207eec04c1b28c2ef7.tar.xz mullvadvpn-3dbbd423d0596e398d72c5207eec04c1b28c2ef7.zip | |
Send is now &mut self
| -rw-r--r-- | talpid_ipc/src/zmq_ipc.rs | 4 | ||||
| -rw-r--r-- | talpid_ipc/tests/zmq_integration_tests.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/talpid_ipc/src/zmq_ipc.rs b/talpid_ipc/src/zmq_ipc.rs index 0e8f18517f..d39249bd6f 100644 --- a/talpid_ipc/src/zmq_ipc.rs +++ b/talpid_ipc/src/zmq_ipc.rs @@ -58,12 +58,12 @@ impl IpcClient { } } - pub fn send(mut self, message: &[u8]) -> Result<()> { + pub fn send(&mut self, message: &[u8]) -> Result<()> { if self.socket.is_none() { self.connect().chain_err(|| ErrorKind::SendError)?; } - let socket = self.socket.unwrap(); + let socket = self.socket.as_ref().unwrap(); socket.send(message, 0).chain_err(|| ErrorKind::SendError) } diff --git a/talpid_ipc/tests/zmq_integration_tests.rs b/talpid_ipc/tests/zmq_integration_tests.rs index c72549a837..b7993c3553 100644 --- a/talpid_ipc/tests/zmq_integration_tests.rs +++ b/talpid_ipc/tests/zmq_integration_tests.rs @@ -17,7 +17,7 @@ mod zmq_integration_tests { fn can_connect_and_send_and_receive_messages() { let (connection_string, new_messages_rx) = start_server(); - let ipc_client = IpcClient::new(connection_string); + let mut ipc_client = IpcClient::new(connection_string); ipc_client.send(&[1, 3, 3, 7]).expect("Could not send message"); let message = new_messages_rx.recv_timeout(Duration::from_millis(1000)) |
