diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2017-05-23 10:14:55 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2017-05-23 10:14:55 +0200 |
| commit | ab63f2e12d255236e6f3d96aab391f51c28eb629 (patch) | |
| tree | b6e3e9c9c42f0b51cc9afc946708b3be5a48da21 | |
| parent | 54f7f478e36faf5b8b015050521644def03e33c5 (diff) | |
| download | mullvadvpn-ab63f2e12d255236e6f3d96aab391f51c28eb629.tar.xz mullvadvpn-ab63f2e12d255236e6f3d96aab391f51c28eb629.zip | |
Rename (tx, rx) to more descriptive names
| -rw-r--r-- | talpid_cli/src/main.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/talpid_cli/src/main.rs b/talpid_cli/src/main.rs index 69410ab652..8433fa03e8 100644 --- a/talpid_cli/src/main.rs +++ b/talpid_cli/src/main.rs @@ -68,14 +68,12 @@ fn main_loop(command: &OpenVpnCommand, plugin_path: &Path) -> Result<()> { } fn create_openvpn_monitor(plugin_path: &Path) -> Result<(OpenVpnMonitor, Receiver<OpenVpnEvent>)> { - let (tx, rx) = mpsc::channel(); - let tx_mutex = Mutex::new(tx); + let (event_tx, event_rx) = mpsc::channel(); + let event_tx_mutex = Mutex::new(event_tx); let on_event = move |event: OpenVpnEvent| { - let tx_lock = tx_mutex.lock().expect("Unable to lock tx_mutex"); - tx_lock.send(event).expect("Unable to send on tx_lock"); - println!("talpid_cli on_event fired and DONE") + event_tx_mutex.lock().unwrap().send(event).expect("Unable to send on tx_lock"); }; let monitor = OpenVpnMonitor::new(on_event, plugin_path) .chain_err(|| "Unable to start OpenVPN monitor")?; - Ok((monitor, rx)) + Ok((monitor, event_rx)) } |
