fix: collapse nested if-let blocks to satisfy clippy collapsible_if lint
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -201,8 +201,8 @@ pub(in crate::agents::pool) async fn run_server_owned_completion(
|
|||||||
|
|
||||||
// Kill any in-flight cargo test processes for this worktree so they don't
|
// Kill any in-flight cargo test processes for this worktree so they don't
|
||||||
// hold the build lock while gates try to run.
|
// hold the build lock while gates try to run.
|
||||||
if let Some(wt_path) = worktree_path.as_ref() {
|
if let Some(wt_path) = worktree_path.as_ref()
|
||||||
if let Ok(output) = std::process::Command::new("pgrep")
|
&& let Ok(output) = std::process::Command::new("pgrep")
|
||||||
.args(["-f", &format!("--manifest-path {}/Cargo.toml", wt_path.display())])
|
.args(["-f", &format!("--manifest-path {}/Cargo.toml", wt_path.display())])
|
||||||
.output()
|
.output()
|
||||||
{
|
{
|
||||||
@@ -216,7 +216,6 @@ pub(in crate::agents::pool) async fn run_server_owned_completion(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Run acceptance gates.
|
// Run acceptance gates.
|
||||||
let (gates_passed, gate_output) = if let Some(wt_path) = worktree_path {
|
let (gates_passed, gate_output) = if let Some(wt_path) = worktree_path {
|
||||||
|
|||||||
@@ -399,13 +399,13 @@ pub(super) async fn tool_run_tests(args: &Value, ctx: &AppContext) -> Result<Str
|
|||||||
// Kill any existing test job for this worktree.
|
// Kill any existing test job for this worktree.
|
||||||
{
|
{
|
||||||
let mut jobs = ctx.test_jobs.lock().map_err(|e| e.to_string())?;
|
let mut jobs = ctx.test_jobs.lock().map_err(|e| e.to_string())?;
|
||||||
if let Some(mut old_job) = jobs.remove(&working_dir) {
|
if let Some(mut old_job) = jobs.remove(&working_dir)
|
||||||
if let Some(ref mut child) = old_job.child {
|
&& let Some(ref mut child) = old_job.child
|
||||||
|
{
|
||||||
let _ = child.kill();
|
let _ = child.kill();
|
||||||
let _ = child.wait();
|
let _ = child.wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Spawn the test process.
|
// Spawn the test process.
|
||||||
let child = std::process::Command::new("bash")
|
let child = std::process::Command::new("bash")
|
||||||
|
|||||||
Reference in New Issue
Block a user