Use to_string_lossy to avoid relying on Debug-outputs

This commit is contained in:
Marie Katrine Ekeberg 2022-09-11 20:39:04 +02:00 committed by David Peter
parent 90e860c7a5
commit d6b1d16bfc
1 changed files with 4 additions and 1 deletions

View File

@ -96,7 +96,10 @@ pub fn execute_commands<I: Iterator<Item = io::Result<Command>>>(
pub fn handle_cmd_error(cmd: Option<&Command>, err: io::Error) -> ExitCode {
match (cmd, err) {
(Some(cmd), err) if err.kind() == io::ErrorKind::NotFound => {
print_error(format!("Command not found: {:?}", cmd.get_program()));
print_error(format!(
"Command not found: {}",
cmd.get_program().to_string_lossy()
));
ExitCode::GeneralError
}
(_, err) => {