diff --git a/crates/nu-cli/src/errors.rs b/crates/nu-cli/src/errors.rs index 4c04481fe0..fc63b34714 100644 --- a/crates/nu-cli/src/errors.rs +++ b/crates/nu-cli/src/errors.rs @@ -401,7 +401,7 @@ pub fn report_shell_error( Diagnostic::error() .with_message("External command") .with_labels(vec![ - Label::primary(diag_file_id, diag_range).with_message(format!("{}", error)) + Label::primary(diag_file_id, diag_range).with_message(error.to_string()) ]) } }; diff --git a/crates/nu-command/src/run_external.rs b/crates/nu-command/src/run_external.rs index 15204ba377..e89e471eda 100644 --- a/crates/nu-command/src/run_external.rs +++ b/crates/nu-command/src/run_external.rs @@ -46,7 +46,7 @@ impl<'call, 'contex> ExternalCommand<'call, 'contex> { call: &'call Call, context: &'contex EvaluationContext, ) -> Result { - if call.positional.len() == 0 { + if call.positional.is_empty() { return Err(ShellError::ExternalNotSupported(call.head)); }