mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 13:47:47 +02:00
Do some str collect cleanup (#312)
This commit is contained in:
@ -94,7 +94,7 @@ prints out the list properly."#
|
||||
let mut items = vec![];
|
||||
|
||||
for (i, (c, v)) in cols.into_iter().zip(vals.into_iter()).enumerate() {
|
||||
items.push((i, c, v.into_string()))
|
||||
items.push((i, c, v.into_string(", ")))
|
||||
}
|
||||
|
||||
Ok(create_grid_output2(
|
||||
@ -187,7 +187,7 @@ fn convert_to_list2(iter: impl IntoIterator<Item = Value>) -> Option<Vec<(usize,
|
||||
let mut row = vec![row_num.to_string()];
|
||||
|
||||
if headers.is_empty() {
|
||||
row.push(item.into_string())
|
||||
row.push(item.into_string(", "))
|
||||
} else {
|
||||
for header in headers.iter().skip(1) {
|
||||
let result = match item {
|
||||
@ -201,7 +201,7 @@ fn convert_to_list2(iter: impl IntoIterator<Item = Value>) -> Option<Vec<(usize,
|
||||
};
|
||||
|
||||
match result {
|
||||
Ok(value) => row.push(value.into_string()),
|
||||
Ok(value) => row.push(value.into_string(", ")),
|
||||
Err(_) => row.push(String::new()),
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ impl Command for Table {
|
||||
style: nu_table::TextStyle::default_field(),
|
||||
},
|
||||
StyledString {
|
||||
contents: v.into_string(),
|
||||
contents: v.into_string(", "),
|
||||
style: nu_table::TextStyle::default(),
|
||||
},
|
||||
])
|
||||
@ -123,7 +123,7 @@ fn convert_to_table(
|
||||
let mut row = vec![row_num.to_string()];
|
||||
|
||||
if headers.is_empty() {
|
||||
row.push(item.into_string())
|
||||
row.push(item.into_string(", "))
|
||||
} else {
|
||||
for header in headers.iter().skip(1) {
|
||||
let result = match item {
|
||||
@ -137,7 +137,7 @@ fn convert_to_table(
|
||||
};
|
||||
|
||||
match result {
|
||||
Ok(value) => row.push(value.into_string()),
|
||||
Ok(value) => row.push(value.into_string(", ")),
|
||||
Err(_) => row.push(String::new()),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user