Skip to content

Commit 8e1e761

Browse files
committed
Fix Value::Error use
1 parent 997a165 commit 8e1e761

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

crates/nu-protocol/src/pipeline_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl PipelineData {
202202

203203
pub fn drain(self) -> Result<(), ShellError> {
204204
match self {
205-
PipelineData::Value(Value::Error { error }, _) => Err(error),
205+
PipelineData::Value(Value::Error { error }, _) => Err(*error),
206206
PipelineData::Value(_, _) => Ok(()),
207207
PipelineData::ListStream(stream, _) => stream.drain(),
208208
PipelineData::ExternalStream { stdout, stderr, .. } => {

crates/nu-protocol/src/value/stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl RawStream {
8181
match next {
8282
Ok(val) => {
8383
if let Value::Error { error } = val {
84-
return Err(error);
84+
return Err(*error);
8585
}
8686
}
8787
Err(err) => return Err(err),
@@ -218,7 +218,7 @@ impl ListStream {
218218
pub fn drain(self) -> Result<(), ShellError> {
219219
for next in self {
220220
if let Value::Error { error } = next {
221-
return Err(error);
221+
return Err(*error);
222222
}
223223
}
224224
Ok(())

0 commit comments

Comments
 (0)