Skip to content

refactor: replace complex pipe-closure with simple then_some#373

Merged
KSXGitHub merged 1 commit intomasterfrom
claude/research-cli-test-args-b6IUi
Mar 25, 2026
Merged

refactor: replace complex pipe-closure with simple then_some#373
KSXGitHub merged 1 commit intomasterfrom
claude/research-cli-test-args-b6IUi

Conversation

@KSXGitHub
Copy link
Owner

Use `recursive.then_some("-R")` instead of `.pipe(|cmd| if recursive { cmd.with_arg("-R") } else { cmd })` for clearer intent.

https://claude.ai/code/session_01RNq8cLPfc5PEN4M8cQodwx
@KSXGitHub KSXGitHub requested a review from Copilot March 25, 2026 01:43
@KSXGitHub KSXGitHub marked this pull request as ready for review March 25, 2026 01:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the chmod command construction in cli_errors integration tests to avoid a conditional pipe closure by using bool::then_some with with_args, keeping behavior equivalent while simplifying the command chain.

Changes:

  • Replace pipe(|cmd| if recursive { ... } else { ... }) with .with_args(recursive.then_some("-R")) in fs_permission.

@KSXGitHub KSXGitHub merged commit 51e784d into master Mar 25, 2026
17 checks passed
@KSXGitHub KSXGitHub deleted the claude/research-cli-test-args-b6IUi branch March 25, 2026 01:48
@github-actions
Copy link

Performance Regression Reports

commit: 5f09a4b

There are no regressions.

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.

3 participants