nushell/src/commands/to_toml.rs
2019-06-02 06:26:04 +12:00

10 lines
296 B
Rust

use crate::object::{Primitive, Value};
use crate::prelude::*;
pub fn to_toml(args: CommandArgs) -> Result<OutputStream, ShellError> {
let out = args.input;
Ok(out
.map(|a| ReturnValue::Value(Value::Primitive(Primitive::String(toml::to_string(&a).unwrap()))))
.boxed())
}