diff --git a/crates/ledger-cli/tests/format_upgrade.rs b/crates/ledger-cli/tests/format_upgrade.rs index ec4d54c..b5a9dba 100644 --- a/crates/ledger-cli/tests/format_upgrade.rs +++ b/crates/ledger-cli/tests/format_upgrade.rs @@ -978,12 +978,10 @@ fn books_p2_served_cut_over_whole() { /// with the command's exit code as its own: util-linux's spelling on /// Linux, BSD's on macOS (no `-f`, no `-c`; the command after the file). fn script_args(command: &str) -> Vec { - if cfg!(target_os = "macos") { - ["-qeF", "/dev/null", "/bin/sh", "-c", command] + let args: &[&str] = if cfg!(target_os = "macos") { + &["-qeF", "/dev/null", "/bin/sh", "-c", command] } else { - ["-qefc", command, "/dev/null"] - } - .into_iter() - .map(String::from) - .collect() + &["-qefc", command, "/dev/null"] + }; + args.iter().map(|a| a.to_string()).collect() } diff --git a/crates/ledger-cli/tests/open_while_held.rs b/crates/ledger-cli/tests/open_while_held.rs index 9f79a2f..d1275c8 100644 --- a/crates/ledger-cli/tests/open_while_held.rs +++ b/crates/ledger-cli/tests/open_while_held.rs @@ -2953,12 +2953,10 @@ fn token_check_says_where_the_token_file_stands_and_an_unreadable_one_is_said() /// with the command's exit code as its own: util-linux's spelling on /// Linux, BSD's on macOS (no `-f`, no `-c`; the command after the file). fn script_args(command: &str) -> Vec { - if cfg!(target_os = "macos") { - ["-qeF", "/dev/null", "/bin/sh", "-c", command] + let args: &[&str] = if cfg!(target_os = "macos") { + &["-qeF", "/dev/null", "/bin/sh", "-c", command] } else { - ["-qefc", command, "/dev/null"] - } - .into_iter() - .map(String::from) - .collect() + &["-qefc", command, "/dev/null"] + }; + args.iter().map(|a| a.to_string()).collect() } diff --git a/crates/ledger-cli/tests/setup.rs b/crates/ledger-cli/tests/setup.rs index 0a76c19..8e2dddb 100644 --- a/crates/ledger-cli/tests/setup.rs +++ b/crates/ledger-cli/tests/setup.rs @@ -163,14 +163,12 @@ fn another_home_ignores_this_accounts_data_home() { /// with the command's exit code as its own: util-linux's spelling on /// Linux, BSD's on macOS (no `-f`, no `-c`; the command after the file). fn script_args(command: &str) -> Vec { - if cfg!(target_os = "macos") { - ["-qeF", "/dev/null", "/bin/sh", "-c", command] + let args: &[&str] = if cfg!(target_os = "macos") { + &["-qeF", "/dev/null", "/bin/sh", "-c", command] } else { - ["-qefc", command, "/dev/null"] - } - .into_iter() - .map(String::from) - .collect() + &["-qefc", command, "/dev/null"] + }; + args.iter().map(|a| a.to_string()).collect() } /// Run `args` at a terminal (a pseudo-terminal, through `script`),