Successfully rendering my first template.
This commit is contained in:
parent
e26b158ab4
commit
15c8ee57a7
@ -69,6 +69,13 @@ fn read_context_from_stdin() -> serde_json::map::Map<String, serde_json::Value>
|
||||
|
||||
impl Renderable for serde_json::Value {
|
||||
fn render(&self) -> String {
|
||||
self.to_string()
|
||||
match self {
|
||||
serde_json::Value::Null => "".to_owned(),
|
||||
serde_json::Value::Bool(boolean) => boolean.to_string(),
|
||||
serde_json::Value::Number(num) => num.to_string(),
|
||||
serde_json::Value::String(string) => string.to_string(),
|
||||
serde_json::Value::Array(_arr) => panic!("Attempted to render an array"),
|
||||
serde_json::Value::Object(_obj) => panic!("Attempted to render an object"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user