diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-09-27 10:20:55 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-09-27 10:20:55 +0200 |
| commit | 7ef43ee157e737799d2b69c9f1806b9acec2baa6 (patch) | |
| tree | 08480c4aa4bbd907ca03e22336c1dfdc178ad9db | |
| parent | 309fb57ff25726245b7662070de6fe1fa30fe0d8 (diff) | |
| download | mullvadvpn-7ef43ee157e737799d2b69c9f1806b9acec2baa6.tar.xz mullvadvpn-7ef43ee157e737799d2b69c9f1806b9acec2baa6.zip | |
Re-introduce field name in OpenVpnEventApi
| -rw-r--r-- | talpid-core/src/tunnel/openvpn.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/talpid-core/src/tunnel/openvpn.rs b/talpid-core/src/tunnel/openvpn.rs index caa6399849..f2cc1da7da 100644 --- a/talpid-core/src/tunnel/openvpn.rs +++ b/talpid-core/src/tunnel/openvpn.rs @@ -235,7 +235,7 @@ mod event_server { where L: Fn(OpenVpnPluginEvent, HashMap<String, String>) + Send + Sync + 'static, { - let rpc = OpenVpnEventApiImpl(on_event); + let rpc = OpenVpnEventApiImpl { on_event }; let mut io = IoHandler::new(); io.extend_with(rpc.to_delegate()); talpid_ipc::IpcServer::start(io.into()) @@ -249,9 +249,9 @@ mod event_server { } } - struct OpenVpnEventApiImpl<L>(L) - where - L: Fn(OpenVpnPluginEvent, HashMap<String, String>) + Send + Sync + 'static; + struct OpenVpnEventApiImpl<L> { + on_event: L, + } impl<L> OpenVpnEventApi for OpenVpnEventApiImpl<L> where @@ -263,7 +263,7 @@ mod event_server { env: HashMap<String, String>, ) -> Result<(), Error> { debug!("OpenVPN event {:?}", event); - (self.0)(event, env); + (self.on_event)(event, env); Ok(()) } } |
