Initial implementation of custom Renderable trait.

This commit is contained in:
Tom Alexander
2020-04-11 19:11:14 -04:00
parent af5122ab9f
commit e26b158ab4
4 changed files with 17 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ extern crate nom;
use renderer::compile_template;
use renderer::CompiledTemplate;
use renderer::DustRenderer;
use renderer::Renderable;
use std::env;
use std::fs;
use std::io::{self, Read};
@@ -65,3 +66,9 @@ fn read_context_from_stdin() -> serde_json::map::Map<String, serde_json::Value>
_ => panic!("Expected context to be an object"),
}
}
impl Renderable for serde_json::Value {
fn render(&self) -> String {
self.to_string()
}
}