mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 02:45:08 +02:00
external with redirection
This commit is contained in:
@ -20,6 +20,7 @@ pub enum Type {
|
||||
ValueStream,
|
||||
Unknown,
|
||||
Error,
|
||||
Binary,
|
||||
}
|
||||
|
||||
impl Display for Type {
|
||||
@ -43,6 +44,7 @@ impl Display for Type {
|
||||
Type::ValueStream => write!(f, "value stream"),
|
||||
Type::Unknown => write!(f, "unknown"),
|
||||
Type::Error => write!(f, "error"),
|
||||
Type::Binary => write!(f, "binary"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,10 @@ pub enum Value {
|
||||
Error {
|
||||
error: ShellError,
|
||||
},
|
||||
Binary {
|
||||
val: Vec<u8>,
|
||||
span: Span,
|
||||
},
|
||||
}
|
||||
|
||||
impl Value {
|
||||
@ -83,6 +87,7 @@ impl Value {
|
||||
Value::Block { span, .. } => *span,
|
||||
Value::Stream { span, .. } => *span,
|
||||
Value::Nothing { span, .. } => *span,
|
||||
Value::Binary { span, .. } => *span,
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,6 +105,7 @@ impl Value {
|
||||
Value::Block { span, .. } => *span = new_span,
|
||||
Value::Nothing { span, .. } => *span = new_span,
|
||||
Value::Error { .. } => {}
|
||||
Value::Binary { span, .. } => *span = new_span,
|
||||
}
|
||||
|
||||
self
|
||||
@ -121,6 +127,7 @@ impl Value {
|
||||
Value::Block { .. } => Type::Block,
|
||||
Value::Stream { .. } => Type::ValueStream,
|
||||
Value::Error { .. } => Type::Error,
|
||||
Value::Binary { .. } => Type::Binary,
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,6 +166,7 @@ impl Value {
|
||||
Value::Block { val, .. } => format!("<Block {}>", val),
|
||||
Value::Nothing { .. } => String::new(),
|
||||
Value::Error { error } => format!("{:?}", error),
|
||||
Value::Binary { val, .. } => format!("{:?}", val),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,8 +30,7 @@ impl Iterator for ValueStream {
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
{
|
||||
let mut iter = self.0.borrow_mut();
|
||||
iter.next()
|
||||
self.0.borrow_mut().next()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user