nushell/src/commands/to_array.rs
Jonathan Turner 62b648ceb8 Add save sink
2019-06-08 05:13:38 +12:00

11 lines
276 B
Rust

use crate::object::Value;
use crate::prelude::*;
pub fn to_array(args: CommandArgs) -> Result<OutputStream, ShellError> {
let out = args.input.collect();
Ok(out
.map(|vec: Vec<_>| single_output(Value::List(vec)))
.flatten_stream()
.boxed())
}