mirror of
https://github.com/nushell/nushell.git
synced 2024-11-23 00:43:33 +01: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
@ -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 New Issue
Block a user