mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Add range to the math reductions (#296)
This commit is contained in:
@ -84,6 +84,14 @@ pub fn calculate(
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
}
|
||||
PipelineData::Value(Value::Range { val, .. }) => {
|
||||
let new_vals: Result<Vec<Value>, ShellError> = val
|
||||
.into_range_iter()?
|
||||
.map(|val| mf(&[val], &name))
|
||||
.collect();
|
||||
|
||||
mf(&new_vals?, &name)
|
||||
}
|
||||
PipelineData::Value(val) => mf(&[val], &name),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user