"maybe text codec" version 2 (#871)

* Add a RawStream that can be binary or string

* Finish up updating the into's
This commit is contained in:
JT
2022-01-28 13:32:33 -05:00
committed by GitHub
parent 3f9fa28ae3
commit 020ad24b25
26 changed files with 326 additions and 433 deletions

View File

@ -2,7 +2,7 @@ use nu_engine::{get_full_help, CallExt};
use nu_protocol::ast::Call;
use nu_protocol::engine::{Command, EngineState, Stack};
use nu_protocol::{
ByteStream, Category, Example, IntoPipelineData, PipelineData, ShellError, Signature, Spanned,
Category, Example, IntoPipelineData, PipelineData, RawStream, ShellError, Signature, Spanned,
SyntaxShape, Value,
};
use std::io::{BufRead, BufReader, Read};
@ -120,11 +120,8 @@ impl Command for Open {
let buf_reader = BufReader::new(file);
let output = PipelineData::ByteStream(
ByteStream {
stream: Box::new(BufferedReader { input: buf_reader }),
ctrlc,
},
let output = PipelineData::RawStream(
RawStream::new(Box::new(BufferedReader { input: buf_reader }), ctrlc),
call_span,
None,
);