From 7a7394837e1d714eb66a98b9c9954cc9951dab3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Milenkovi=C4=87?= Date: Sun, 8 Dec 2024 15:59:18 +0000 Subject: [PATCH] clippy cleanup --- python/src/cluster.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/python/src/cluster.rs b/python/src/cluster.rs index e395e45f6..f5da9298a 100644 --- a/python/src/cluster.rs +++ b/python/src/cluster.rs @@ -68,7 +68,7 @@ impl PyScheduler { return Err(PyException::new_err("Scheduler already started")); } let cluster = wait_for_future(py, BallistaCluster::new_from_config(&self.config)) - .map_err(|e| to_pyerr(e))?; + .map_err(to_pyerr)?; let config = self.config.clone(); let address = format!("{}:{}", config.bind_host, config.bind_port); @@ -101,10 +101,9 @@ impl PyScheduler { let mut handle = None; std::mem::swap(&mut self.handle, &mut handle); - match handle { - Some(handle) => handle.abort(), - None => {} - }; + if let Some(handle) = handle { + handle.abort() + } Ok(()) } @@ -216,10 +215,9 @@ impl PyExecutor { let mut handle = None; std::mem::swap(&mut self.handle, &mut handle); - match handle { - Some(handle) => handle.abort(), - None => {} - }; + if let Some(handle) = handle { + handle.abort() + } Ok(()) }