Skip to content

refactor(clippy): collapse if and drop redundant closure in compile/mod.rs#687

Merged
jamesadevine merged 1 commit into
mainfrom
clippy-fixer/collapsible-if-redundant-closure-compile-mod-dead08532592caac
May 22, 2026
Merged

refactor(clippy): collapse if and drop redundant closure in compile/mod.rs#687
jamesadevine merged 1 commit into
mainfrom
clippy-fixer/collapsible-if-redundant-closure-compile-mod-dead08532592caac

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

What clippy found

error: this `if` statement can be collapsed
   --> src/compile/mod.rs:269:5
   |
269 | /     if sync_gitattributes {
270 | |         if let Err(e) = sync_gitattributes_for_output(&yaml_output_path).await {
271 | |             debug!("Skipped .gitattributes update: {}", e);
272 | |         }
273 | |     }

error: redundant closure
   --> src/compile/mod.rs:493:19
   |
493 |         .find_map(|line| crate::detect::parse_header_line(line))
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: replace the closure with the function itself: `crate::detect::parse_header_line`

How it was fixed

  • clippy::collapsible_if (line 269): merged the nested if sync_gitattributes { if let Err(e) = ... } into a single if sync_gitattributes && let Err(e) = ... chain (valid in Rust 2024 edition).
  • clippy::redundant_closure (line 493): replaced |line| crate::detect::parse_header_line(line) with crate::detect::parse_header_line directly.

Only src/compile/mod.rs was touched.

Verification

  • cargo build --all-targets
  • cargo test ✅ (all tests pass)
  • cargo clippy --all-targets --all-features --workspace -- -D warnings ✅ (no warnings in compile/mod.rs)

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • dev.azure.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "dev.azure.com"

See Network Configuration for more information.

Generated by Clippy Fixer · ● 9.8M ·

…od.rs

Fix two clippy lints in src/compile/mod.rs:
- collapsible_if at line 269: merge nested `if sync_gitattributes { if let Err` into a single `if … && let` chain
- redundant_closure at line 493: replace `|line| parse_header_line(line)` with `parse_header_line` directly

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request May 22, 2026
@jamesadevine jamesadevine marked this pull request as ready for review May 22, 2026 13:27
@jamesadevine jamesadevine merged commit 0ee5f51 into main May 22, 2026
@jamesadevine jamesadevine deleted the clippy-fixer/collapsible-if-redundant-closure-compile-mod-dead08532592caac branch May 22, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant