From 64f80dec8f518f67f7a918e068466be25fc788e4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 May 2026 17:43:32 +0000 Subject: [PATCH] refactor(clippy): collapse nested if blocks in detect.rs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/detect.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/detect.rs b/src/detect.rs index 16eb33df..0484fe62 100644 --- a/src/detect.rs +++ b/src/detect.rs @@ -61,15 +61,13 @@ fn scan_directory<'a>( continue; } scan_directory(&path, root, results).await?; - } else if file_type.is_file() { - if let Some(ext) = path.extension().and_then(|e| e.to_str()) { - if ext == "yml" || ext == "yaml" { - if let Some(pipeline) = try_detect_pipeline(&path, root).await? { - debug!("Detected agentic pipeline: {}", path.display()); - results.push(pipeline); - } - } - } + } else if file_type.is_file() + && let Some(ext) = path.extension().and_then(|e| e.to_str()) + && (ext == "yml" || ext == "yaml") + && let Some(pipeline) = try_detect_pipeline(&path, root).await? + { + debug!("Detected agentic pipeline: {}", path.display()); + results.push(pipeline); } }