jsonbuilder 0.1.0

A json builder used to create JSON structures using a simple DSL
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::{
    fs,
    path::{Path, PathBuf},
};

use crate::{config, error::*};

pub fn read(path: PathBuf) -> Result<String> {
    let config = config::Config::new();

    let mut path = Path::new(&config.template_path).join(path);
    path.set_extension("json.jb");

    fs::read_to_string(path).map_err(JsonBuilderError::IO)
}