Skip to content

Commit

Permalink
clippy cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
milenkovicm committed Dec 8, 2024
1 parent 2766e18 commit 7a73948
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions python/src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(())
}
Expand Down Expand Up @@ -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(())
}
Expand Down

0 comments on commit 7a73948

Please sign in to comment.