We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c5575c commit a3070bfCopy full SHA for a3070bf
crates/nu-engine/src/column.rs
@@ -2,18 +2,21 @@ use nu_protocol::Value;
2
use std::collections::HashSet;
3
4
pub fn get_columns(input: &[Value]) -> Vec<String> {
5
- let mut columns = HashSet::new();
+ let mut column_set = HashSet::new();
6
+ let mut columns = Vec::new();
7
for item in input {
8
let Value::Record { val, .. } = item else {
9
return vec![];
10
};
11
12
for col in val.columns() {
- columns.insert(col.to_string());
13
+ if column_set.insert(col) {
14
+ columns.push(col.to_string());
15
+ }
16
}
17
18
- columns.into_iter().collect()
19
+ columns
20
21
22
// If a column doesn't exist in the input, return it.
0 commit comments