diff --git a/crates/nu-command/src/dataframe/values/nu_dataframe/operations.rs b/crates/nu-command/src/dataframe/values/nu_dataframe/operations.rs index beee980f1..95258c5da 100644 --- a/crates/nu-command/src/dataframe/values/nu_dataframe/operations.rs +++ b/crates/nu-command/src/dataframe/values/nu_dataframe/operations.rs @@ -196,7 +196,7 @@ impl NuDataFrame { let df_new = DataFrame::new(new_cols).map_err(|e| { ShellError::SpannedLabeledError( "Error appending dataframe".into(), - format!("Unable to append dataframes: {}", e.to_string()), + format!("Unable to append dataframes: {}", e), span, ) })?; diff --git a/crates/nu-command/src/filters/empty.rs b/crates/nu-command/src/filters/empty.rs index b0e454550..e1b366b6e 100644 --- a/crates/nu-command/src/filters/empty.rs +++ b/crates/nu-command/src/filters/empty.rs @@ -162,7 +162,7 @@ fn process_row( } } else { let mut obj = input.clone(); - for column in column_paths.clone() { + for column in column_paths { let path = column.into_string(); let data = input.get_data_by_key(&path); let is_empty = match data { diff --git a/crates/nu-command/src/filters/flatten.rs b/crates/nu-command/src/filters/flatten.rs index 055b230cc..d6dc85ccd 100644 --- a/crates/nu-command/src/filters/flatten.rs +++ b/crates/nu-command/src/filters/flatten.rs @@ -153,7 +153,7 @@ fn flat_value(columns: &[CellPath], item: &Value, _name_tag: Span) -> Vec for (k, v) in cols.into_iter().zip(vals.into_iter()) { if out.contains_key(&k) { - out.insert(format!("{}_{}", column.to_string(), k), v.clone()); + out.insert(format!("{}_{}", column, k), v.clone()); } else { out.insert(k, v.clone()); } diff --git a/crates/nu-command/src/platform/ansi/command.rs b/crates/nu-command/src/platform/ansi/command.rs index 4bf298f9c..4c2b0532e 100644 --- a/crates/nu-command/src/platform/ansi/command.rs +++ b/crates/nu-command/src/platform/ansi/command.rs @@ -389,7 +389,7 @@ Format: # "attr" => nu_style.attr = Some(v.as_string()?), _ => { return Err(ShellError::IncompatibleParametersSingle( - format!("problem with key: {}", k.to_string()), + format!("problem with key: {}", k), code.span().expect("error with span"), )) } diff --git a/crates/nu-command/src/platform/ansi/gradient.rs b/crates/nu-command/src/platform/ansi/gradient.rs index 1b1c269a8..92defdcf8 100644 --- a/crates/nu-command/src/platform/ansi/gradient.rs +++ b/crates/nu-command/src/platform/ansi/gradient.rs @@ -275,7 +275,7 @@ fn action( } } other => { - let got = format!("value is {}, not string", other.get_type().to_string()); + let got = format!("value is {}, not string", other.get_type()); Value::Error { error: ShellError::TypeMismatch(got, other.span().unwrap_or(*command_span)), diff --git a/crates/nu-command/src/platform/ansi/strip.rs b/crates/nu-command/src/platform/ansi/strip.rs index d3032fa2b..b69e1b06a 100644 --- a/crates/nu-command/src/platform/ansi/strip.rs +++ b/crates/nu-command/src/platform/ansi/strip.rs @@ -90,7 +90,7 @@ fn action(input: &Value, command_span: &Span) -> Value { Value::string(stripped_string, *span) } other => { - let got = format!("value is {}, not string", other.get_type().to_string()); + let got = format!("value is {}, not string", other.get_type()); Value::Error { error: ShellError::TypeMismatch(got, other.span().unwrap_or(*command_span)), diff --git a/crates/nu-command/src/platform/kill.rs b/crates/nu-command/src/platform/kill.rs index 5f291a9e8..405e19caa 100644 --- a/crates/nu-command/src/platform/kill.rs +++ b/crates/nu-command/src/platform/kill.rs @@ -111,7 +111,7 @@ impl Command for Kill { } cmd.arg("-9"); } else if let Some(signal_value) = signal { - cmd.arg(format!("-{}", signal_value.item.to_string())); + cmd.arg(format!("-{}", signal_value.item)); } cmd.arg(pid.to_string()); diff --git a/crates/nu-command/src/viewers/griddle.rs b/crates/nu-command/src/viewers/griddle.rs index bb9c4694f..1da6f0829 100644 --- a/crates/nu-command/src/viewers/griddle.rs +++ b/crates/nu-command/src/viewers/griddle.rs @@ -193,11 +193,7 @@ fn create_grid_output( .unwrap_or_default(); // eprintln!("ansi_style: {:?}", &ansi_style); - let item = format!( - "{} {}", - icon_style.apply(icon).to_string(), - ansi_style.apply(value).to_string() - ); + let item = format!("{} {}", icon_style.apply(icon), ansi_style.apply(value)); let mut cell = Cell::from(item); cell.alignment = Alignment::Left; diff --git a/crates/nu-protocol/src/ty.rs b/crates/nu-protocol/src/ty.rs index b01d74dc8..568a09b6a 100644 --- a/crates/nu-protocol/src/ty.rs +++ b/crates/nu-protocol/src/ty.rs @@ -44,7 +44,7 @@ impl Display for Type { "record<{}>", fields .iter() - .map(|(x, y)| format!("{}: {}", x, y.to_string())) + .map(|(x, y)| format!("{}: {}", x, y)) .collect::>() .join(", "), ), diff --git a/crates/nu_plugin_inc/src/inc.rs b/crates/nu_plugin_inc/src/inc.rs index a221fa4fe..9846a6538 100644 --- a/crates/nu_plugin_inc/src/inc.rs +++ b/crates/nu_plugin_inc/src/inc.rs @@ -92,11 +92,7 @@ impl Inc { x => { let msg = x.as_string().map_err(|e| LabeledError { label: "Unable to extract string".into(), - msg: format!( - "value cannot be converted to string {:?} - {}", - x, - e.to_string() - ), + msg: format!("value cannot be converted to string {:?} - {}", x, e), span: Some(head), })?; diff --git a/src/tests.rs b/src/tests.rs index 35cc4e966..e767ce58a 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -76,7 +76,7 @@ pub fn fail_test(input: &str, expected: &str) -> TestResult { #[cfg(test)] pub fn not_found_msg() -> &'static str { if cfg!(windows) { - "cannot find" + "not found" } else { "No such" }