Make PipelineData helpers collect rawstreams (#969)

This commit is contained in:
JT
2022-02-07 07:44:18 -05:00
committed by GitHub
parent 3ab55f7de9
commit a78c82d811
5 changed files with 74 additions and 28 deletions

View File

@ -103,7 +103,7 @@ fn into_binary(
// TODO: in the future, we may want this to stream out, converting each to bytes
let output = stream.into_bytes()?;
Ok(Value::Binary {
val: output,
val: output.item,
span: head,
}
.into_pipeline_data())

View File

@ -154,7 +154,7 @@ fn string_helper(
// TODO: in the future, we may want this to stream out, converting each to bytes
let output = stream.into_string()?;
Ok(Value::String {
val: output,
val: output.item,
span: head,
}
.into_pipeline_data())

View File

@ -45,7 +45,7 @@ impl Command for Decode {
match input {
PipelineData::RawStream(stream, ..) => {
let bytes: Vec<u8> = stream.into_bytes()?;
let bytes: Vec<u8> = stream.into_bytes()?.item;
let encoding = match Encoding::for_label(encoding.item.as_bytes()) {
None => Err(ShellError::SpannedLabeledError(