From 5fe0fc9135ce90141b79f1b21a94d8b7ef595d56 Mon Sep 17 00:00:00 2001 From: amtoine Date: Sat, 11 Mar 2023 12:24:44 +0100 Subject: [PATCH] remove the useless `.to_string` conversion from `format!`s This commit also makes `clippy` happy. --- crates/nu-command/src/formats/to/nuon.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/nu-command/src/formats/to/nuon.rs b/crates/nu-command/src/formats/to/nuon.rs index 726bea42ed..ccb4af08ec 100644 --- a/crates/nu-command/src/formats/to/nuon.rs +++ b/crates/nu-command/src/formats/to/nuon.rs @@ -197,7 +197,7 @@ pub fn value_to_string( } }) .collect(); - let headers_output = headers.join(&format!(", {nl}{idt_pt}").to_string()); + let headers_output = headers.join(&format!(", {nl}{idt_pt}")); let mut table_output = vec![]; for val in vals { @@ -214,13 +214,13 @@ pub fn value_to_string( } } - table_output.push(row.join(&format!(", {nl}{idt_pt}").to_string())); + table_output.push(row.join(&format!(", {nl}{idt_pt}"))); } Ok(format!( "[{nl}{idt_po}[{nl}{idt_pt}{}{nl}{idt_po}]; {nl}{idt_po}[{nl}{idt_pt}{}{nl}{idt_po}]{nl}{idt}]", headers_output, - table_output.join(&format!("{nl}{idt_po}], {nl}{idt_po}[{nl}{idt_pt}").to_string()) + table_output.join(&format!("{nl}{idt_po}], {nl}{idt_po}[{nl}{idt_pt}")) )) } else { let mut collection = vec![]; @@ -232,7 +232,7 @@ pub fn value_to_string( } Ok(format!( "[{nl}{}{nl}{idt}]", - collection.join(&format!(", {nl}").to_string()) + collection.join(&format!(", {nl}")) )) } } @@ -266,7 +266,7 @@ pub fn value_to_string( } Ok(format!( "{{{nl}{}{nl}{idt}}}", - collection.join(&format!(", {nl}").to_string()) + collection.join(&format!(", {nl}")) )) } Value::LazyRecord { val, .. } => {