Initial implementation of custom Renderable trait.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user