From 99b8e28051ffd86050529df6cf88d2e0b8d24cb8 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 14 Apr 2016 22:13:38 -0700 Subject: [PATCH] Update mod.rs --- parity/hypervisor/mod.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/parity/hypervisor/mod.rs b/parity/hypervisor/mod.rs index d65d5076e..bbc95b150 100644 --- a/parity/hypervisor/mod.rs +++ b/parity/hypervisor/mod.rs @@ -88,20 +88,18 @@ impl Hypervisor { /// Does nothing when it is already started on module is inside the /// main binary fn start_module(&self, module_id: IpcModuleId) { - Self::match_module(&module_id).map(|binary_id| - { - let mut processes = self.processes.write().unwrap(); - { - let process = processes.get(binary_id); - if process.is_some() { - // already started for another module - return; - } + Self::match_module(&module_id).map(|binary_id| { + let mut processes = self.processes.write().unwrap(); + { + if processes.get(binary_id).is_some() { + // already started for another module + return; } - let child = Command::new(binary_id).spawn().unwrap_or_else( - |e| panic!("Hypervisor cannot start binary: {}", e)); - processes.insert(binary_id, child); - }); + } + let child = Command::new(binary_id).spawn().unwrap_or_else( + |e| panic!("Hypervisor cannot start binary: {}", e)); + processes.insert(binary_id, child); + }); } /// Reports if all modules are checked in