mirror of
https://github.com/nushell/nushell
synced 2024-12-27 13:33:16 +00:00
Header filtering out of for loop (#5896)
* remove extra print * dataframe with real index * corrected dataframe tests * clippy error * clippy error * moved header filter out of loop
This commit is contained in:
parent
c0901ef707
commit
ffbc0b0180
1 changed files with 7 additions and 7 deletions
|
@ -364,6 +364,13 @@ fn convert_to_table(
|
|||
headers.insert(0, "#".into());
|
||||
}
|
||||
|
||||
// The header with the INDEX is removed from the table headers since
|
||||
// it is added to the natural table index
|
||||
headers = headers
|
||||
.into_iter()
|
||||
.filter(|header| header != INDEX_COLUMN_NAME)
|
||||
.collect();
|
||||
|
||||
// Vec of Vec of String1, String2 where String1 is datatype and String2 is value
|
||||
let mut data: Vec<Vec<(String, String)>> = Vec::new();
|
||||
|
||||
|
@ -389,13 +396,6 @@ fn convert_to_table(
|
|||
row = vec![("string".to_string(), (row_val).to_string())];
|
||||
}
|
||||
|
||||
// The header with the INDEX is removed from the table headers since
|
||||
// it is added to the natural table index
|
||||
headers = headers
|
||||
.into_iter()
|
||||
.filter(|header| header != INDEX_COLUMN_NAME)
|
||||
.collect();
|
||||
|
||||
if headers.is_empty() {
|
||||
row.push((
|
||||
item.get_type().to_string(),
|
||||
|
|
Loading…
Reference in a new issue