mirror of
https://github.com/nushell/nushell.git
synced 2025-06-05 09:36:44 +02:00
do the records
This commit is contained in:
parent
e354bb766d
commit
c5fc7cd585
@ -240,19 +240,22 @@ pub fn value_to_string(
|
|||||||
for (col, val) in cols.iter().zip(vals) {
|
for (col, val) in cols.iter().zip(vals) {
|
||||||
collection.push(if needs_quotes(col) {
|
collection.push(if needs_quotes(col) {
|
||||||
format!(
|
format!(
|
||||||
"\"{}\": {}",
|
"{idt_po}\"{}\": {}",
|
||||||
col,
|
col,
|
||||||
value_to_string_without_quotes(val, span, depth + 1, indent)?
|
value_to_string_without_quotes(val, span, depth + 1, indent)?
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
format!(
|
format!(
|
||||||
"{}: {}",
|
"{idt_po}{}: {}",
|
||||||
col,
|
col,
|
||||||
value_to_string_without_quotes(val, span, depth + 1, indent)?
|
value_to_string_without_quotes(val, span, depth + 1, indent)?
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Ok(format!("{{{}}}", collection.join(", ")))
|
Ok(format!(
|
||||||
|
"{{{nl}{}{nl}{idt}}}",
|
||||||
|
collection.join(&format!(", {nl}").to_string())
|
||||||
|
))
|
||||||
}
|
}
|
||||||
Value::LazyRecord { val, .. } => {
|
Value::LazyRecord { val, .. } => {
|
||||||
let collected = val.collect()?;
|
let collected = val.collect()?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user