mirror of
https://github.com/nushell/nushell.git
synced 2025-06-05 01:26:42 +02:00
remove the useless .to_string
conversion from format!
s
This commit also makes `clippy` happy.
This commit is contained in:
parent
8465c743dc
commit
5fe0fc9135
@ -197,7 +197,7 @@ pub fn value_to_string(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect();
|
.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![];
|
let mut table_output = vec![];
|
||||||
for val in vals {
|
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!(
|
Ok(format!(
|
||||||
"[{nl}{idt_po}[{nl}{idt_pt}{}{nl}{idt_po}]; {nl}{idt_po}[{nl}{idt_pt}{}{nl}{idt_po}]{nl}{idt}]",
|
"[{nl}{idt_po}[{nl}{idt_pt}{}{nl}{idt_po}]; {nl}{idt_po}[{nl}{idt_pt}{}{nl}{idt_po}]{nl}{idt}]",
|
||||||
headers_output,
|
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 {
|
} else {
|
||||||
let mut collection = vec![];
|
let mut collection = vec![];
|
||||||
@ -232,7 +232,7 @@ pub fn value_to_string(
|
|||||||
}
|
}
|
||||||
Ok(format!(
|
Ok(format!(
|
||||||
"[{nl}{}{nl}{idt}]",
|
"[{nl}{}{nl}{idt}]",
|
||||||
collection.join(&format!(", {nl}").to_string())
|
collection.join(&format!(", {nl}"))
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ pub fn value_to_string(
|
|||||||
}
|
}
|
||||||
Ok(format!(
|
Ok(format!(
|
||||||
"{{{nl}{}{nl}{idt}}}",
|
"{{{nl}{}{nl}{idt}}}",
|
||||||
collection.join(&format!(", {nl}").to_string())
|
collection.join(&format!(", {nl}"))
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
Value::LazyRecord { val, .. } => {
|
Value::LazyRecord { val, .. } => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user