mirror of
https://github.com/openai/codex.git
synced 2026-05-05 20:07:02 +00:00
chore: clippy-2
This commit is contained in:
@@ -73,7 +73,8 @@ impl Shell {
|
||||
return Some(command);
|
||||
}
|
||||
|
||||
let joined = shlex::try_join(command.iter().map(|s| s.as_str())).ok();
|
||||
let joined =
|
||||
shlex::try_join(command.iter().map(std::string::String::as_str)).ok();
|
||||
return joined.map(|arg| {
|
||||
vec![
|
||||
ps.exe.clone(),
|
||||
@@ -111,7 +112,7 @@ fn format_shell_invocation_with_rc(
|
||||
rc_path: &str,
|
||||
) -> Option<Vec<String>> {
|
||||
let joined = strip_bash_lc(command)
|
||||
.or_else(|| shlex::try_join(command.iter().map(|s| s.as_str())).ok())?;
|
||||
.or_else(|| shlex::try_join(command.iter().map(std::string::String::as_str)).ok())?;
|
||||
|
||||
let rc_command = if std::path::Path::new(rc_path).exists() {
|
||||
format!("source {rc_path} && ({joined})")
|
||||
@@ -326,8 +327,9 @@ mod tests {
|
||||
bashrc_path: bashrc_path.to_str().unwrap().to_string(),
|
||||
});
|
||||
|
||||
let actual_cmd = shell
|
||||
.format_default_shell_invocation(input.iter().map(|s| s.to_string()).collect());
|
||||
let actual_cmd = shell.format_default_shell_invocation(
|
||||
input.iter().map(std::string::ToString::to_string).collect(),
|
||||
);
|
||||
let expected_cmd = expected_cmd
|
||||
.iter()
|
||||
.map(|s| s.replace("BASHRC_PATH", bashrc_path.to_str().unwrap()))
|
||||
@@ -433,8 +435,9 @@ mod macos_tests {
|
||||
zshrc_path: zshrc_path.to_str().unwrap().to_string(),
|
||||
});
|
||||
|
||||
let actual_cmd = shell
|
||||
.format_default_shell_invocation(input.iter().map(|s| s.to_string()).collect());
|
||||
let actual_cmd = shell.format_default_shell_invocation(
|
||||
input.iter().map(std::string::ToString::to_string).collect(),
|
||||
);
|
||||
let expected_cmd = expected_cmd
|
||||
.iter()
|
||||
.map(|s| s.replace("ZSHRC_PATH", zshrc_path.to_str().unwrap()))
|
||||
|
||||
Reference in New Issue
Block a user