From 29b7d275df351e08ee91abb8da3cfd306c090585 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 25 Mar 2026 01:33:04 +0000 Subject: [PATCH] refactor(tests): simplify conditional chmod -R argument 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 --- tests/cli_errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cli_errors.rs b/tests/cli_errors.rs index bb2c089b..221d61a0 100644 --- a/tests/cli_errors.rs +++ b/tests/cli_errors.rs @@ -35,7 +35,7 @@ fn stdio(command: Command) -> Command { #[cfg(unix)] fn fs_permission(path: impl AsRef, permission: &'static str, recursive: bool) { let Output { status, stderr, .. } = Command::new("chmod") - .pipe(|cmd| if recursive { cmd.with_arg("-R") } else { cmd }) + .with_args(recursive.then_some("-R")) .with_arg(permission) .with_arg(path.as_ref()) .with_stdin(Stdio::null())