nushell/src/commands/to_array.rs

11 lines
276 B
Rust
Raw Normal View History

2019-05-16 00:58:44 +02:00
use crate::object::Value;
2019-05-13 23:00:25 +02:00
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())
2019-05-13 23:00:25 +02:00
}