diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-08-29 16:23:02 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-08-29 16:23:02 +0200 |
| commit | 9ff26e7c747973e3a8dac7ca295b3ff1addec57e (patch) | |
| tree | 80acb66d8897a134c90e339d6e564f13972bcc76 | |
| parent | f829305fc06daeebd4fe6a595eecdc1ddf8c419e (diff) | |
| download | mullvadvpn-9ff26e7c747973e3a8dac7ca295b3ff1addec57e.tar.xz mullvadvpn-9ff26e7c747973e3a8dac7ca295b3ff1addec57e.zip | |
Implement Debug for IpcServer
| -rw-r--r-- | talpid-ipc/src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/talpid-ipc/src/lib.rs b/talpid-ipc/src/lib.rs index 3ef9bf4733..9875bb198e 100644 --- a/talpid-ipc/src/lib.rs +++ b/talpid-ipc/src/lib.rs @@ -15,6 +15,7 @@ extern crate url; use jsonrpc_core::{MetaIoHandler, Metadata}; use jsonrpc_ws_server::{MetaExtractor, NoopExtractor, Server, ServerBuilder}; +use std::fmt; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; @@ -79,6 +80,17 @@ impl IpcServer { } } +// FIXME: This custom impl is because `Server` does not implement `Debug` yet: +// https://github.com/paritytech/jsonrpc/pull/195 +impl fmt::Debug for IpcServer { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("IpcServer") + .field("address", &self.address) + .finish() + } +} + + #[derive(Clone)] pub struct CloseHandle(jsonrpc_ws_server::CloseHandle); |
