mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Pipeline sink refactor (#1359)
* Refactor pipeline ahead of block changes. Add '-c' commandline option * Update pipelining an error value * Fmt * Clippy * Add stdin redirect for -c flag * Add stdin redirect for -c flag
This commit is contained in:
@ -204,6 +204,12 @@ pub struct SpannedExpression {
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
impl SpannedExpression {
|
||||
pub fn new(expr: Expression, span: Span) -> SpannedExpression {
|
||||
SpannedExpression { expr, span }
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Deref for SpannedExpression {
|
||||
type Target = Expression;
|
||||
|
||||
|
@ -102,7 +102,7 @@ impl Plugin for Average {
|
||||
}
|
||||
UntaggedValue::Primitive(Primitive::Bytes(bytes)) => {
|
||||
let avg = *bytes as f64 / self.count as f64;
|
||||
let primitive_value: UntaggedValue = Primitive::from(avg).into();
|
||||
let primitive_value: UntaggedValue = UntaggedValue::bytes(avg as u64);
|
||||
let tagged_value = primitive_value.into_value(inner.tag.clone());
|
||||
Ok(vec![ReturnSuccess::value(tagged_value)])
|
||||
}
|
||||
|
Reference in New Issue
Block a user