hjson2json 0.1.0

Json wrapper for deprecated Hjson
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#[macro_use]
extern crate error_chain;
extern crate serde;
extern crate serde_hjson;
extern crate serde_json;

pub mod errors;
pub use errors::{Error, Result};

pub fn convert(s: &str) -> Result<String> {
    let value: serde_hjson::Value = serde_hjson::from_str(s)?;
    serde_json::to_string_pretty(&value).map_err(|e| e.into())
}