diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-03-16 09:52:34 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-03-16 09:52:34 +0100 |
| commit | c0d0e813d560958b0e618091cd8bf682e8b70998 (patch) | |
| tree | d6fd62f9a99484254eb5afb4c6d22d8942fdaf55 /talpid_ipc/src | |
| parent | f34a0d45dadfc0a7432b8dc76aa0e8cc1e677c01 (diff) | |
| download | mullvadvpn-c0d0e813d560958b0e618091cd8bf682e8b70998.tar.xz mullvadvpn-c0d0e813d560958b0e618091cd8bf682e8b70998.zip | |
Make use of bail! macro in error_chain
Diffstat (limited to 'talpid_ipc/src')
| -rw-r--r-- | talpid_ipc/src/nop_ipc.rs | 4 | ||||
| -rw-r--r-- | talpid_ipc/src/zmq_ipc.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/talpid_ipc/src/nop_ipc.rs b/talpid_ipc/src/nop_ipc.rs index 9a767f229d..50d4fae791 100644 --- a/talpid_ipc/src/nop_ipc.rs +++ b/talpid_ipc/src/nop_ipc.rs @@ -12,7 +12,7 @@ pub fn start_new_server<T, F>(_on_message: F) -> Result<IpcServerId> where T: serde::Deserialize + 'static, F: FnMut(Result<T>) + Send + 'static { - Err(ErrorKind::CouldNotStartServer.into()) + bail!(ErrorKind::CouldNotStartServer); } pub struct IpcClient<T> @@ -29,6 +29,6 @@ impl<T> IpcClient<T> } pub fn send(&mut self, _message: &T) -> Result<()> { - Err(ErrorKind::SendError.into()) + bail!(ErrorKind::SendError); } } diff --git a/talpid_ipc/src/zmq_ipc.rs b/talpid_ipc/src/zmq_ipc.rs index 7a9c6759b5..ff29edc312 100644 --- a/talpid_ipc/src/zmq_ipc.rs +++ b/talpid_ipc/src/zmq_ipc.rs @@ -27,7 +27,7 @@ pub fn start_new_server<T, F>(on_message: F) -> Result<IpcServerId> return Ok(connection_string); } } - Err(ErrorKind::CouldNotStartServer.into()) + bail!(ErrorKind::CouldNotStartServer) } fn start_zmq_server(connection_string: &str) -> zmq::Result<zmq::Socket> { |
