chore: clippy-2

This commit is contained in:
jimmyfraiture
2025-09-22 13:21:21 +01:00
parent 5996ee0e5f
commit 3b526789b7
79 changed files with 657 additions and 599 deletions

View File

@@ -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()))