mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 21:17:52 +02:00
Take all rows having the column present.
This commit is contained in:
@ -37,7 +37,7 @@ pub fn compact(
|
||||
CompactArgs { rest: columns }: CompactArgs,
|
||||
RunnableContext { input, .. }: RunnableContext,
|
||||
) -> Result<OutputStream, ShellError> {
|
||||
let objects = input.values.take_while(move |item| {
|
||||
let objects = input.values.filter(move |item| {
|
||||
let keep = if columns.is_empty() {
|
||||
item.is_some()
|
||||
} else {
|
||||
|
@ -59,7 +59,7 @@ fn default(
|
||||
if should_add {
|
||||
match item.insert_data_at_path(&column.item, value.item.clone()) {
|
||||
Some(new_value) => result.push_back(ReturnSuccess::value(new_value)),
|
||||
None => {}
|
||||
None => result.push_back(ReturnSuccess::value(item)),
|
||||
}
|
||||
} else {
|
||||
result.push_back(ReturnSuccess::value(item));
|
||||
|
Reference in New Issue
Block a user