mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 04:45:04 +02:00
Make 'for' implicitly filter out nothings (#4536)
* Make 'for' implicitly filter out nothings * Fix test
This commit is contained in:
@ -109,6 +109,7 @@ impl Command for For {
|
||||
Err(error) => Value::Error { error },
|
||||
}
|
||||
})
|
||||
.filter(|x| !x.is_nothing())
|
||||
.into_pipeline_data(ctrlc)),
|
||||
Value::Range { val, .. } => Ok(val
|
||||
.into_range_iter()?
|
||||
@ -146,6 +147,7 @@ impl Command for For {
|
||||
Err(error) => Value::Error { error },
|
||||
}
|
||||
})
|
||||
.filter(|x| !x.is_nothing())
|
||||
.into_pipeline_data(ctrlc)),
|
||||
x => {
|
||||
stack.add_var(var_id, x);
|
||||
|
Reference in New Issue
Block a user