Improve "Cannot convert argument to string" msg (#7161)

This commit is contained in:
Leon 2022-11-19 06:33:01 +10:00 committed by GitHub
parent 1784b4bf50
commit 2dd4cb9f7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,7 @@ impl Command for External {
.map(|item| Spanned { item, span }) .map(|item| Spanned { item, span })
.map_err(|_| { .map_err(|_| {
ShellError::ExternalCommand( ShellError::ExternalCommand(
"Cannot convert argument to a string".into(), format!("Cannot convert {} to a string", value.get_type()),
"All arguments to an external command need to be string-compatible".into(), "All arguments to an external command need to be string-compatible".into(),
span, span,
) )
@ -267,7 +267,7 @@ impl ExternalCommand {
Some(s) => { Some(s) => {
if reconfirm_command_name { if reconfirm_command_name {
format!( format!(
"'{}' was not found, did you mean '{s}'?", "'{}' was not found; did you mean '{s}'?",
self.name.item self.name.item
) )
} else if self.name.item == s { } else if self.name.item == s {