machin 0.6.2

Machin is a cli program that simplifies file conversions and batch processing. It's inspired from filter/map/reduce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub mod jsontoyaml;

use crate::machmap::json::jsontoyaml::JsonToYaml;
use crate::machmap::{HashMap, InputTo, JsonInputFile};

impl<'a> JsonInputFile<'a> {
    pub fn new(input_file: &'a str, output_file: &'a str) -> JsonInputFile<'a> {
        let yaml = JsonToYaml::new(input_file, output_file);

        let mut map: HashMap<&'a str, Box<dyn InputTo<'a> + 'a>> = HashMap::new();
        map.insert("text/x-yaml", Box::new(yaml));
        JsonInputFile {
            input_file,
            output_file,
            map,
        }
    }
}