nushell/src/commands/to_toml.rs

10 lines
296 B
Rust
Raw Normal View History

2019-06-01 20:26:04 +02:00
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())
}