From d638e500f3cb40c1e8b23244664558bd0014257c Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Thu, 7 Jan 2016 11:10:52 +0800 Subject: [PATCH] (test) show data backend in render example --- examples/render.rs | 4 +++- examples/template.hbs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/render.rs b/examples/render.rs index cf4c0ab77..c93e4fc64 100644 --- a/examples/render.rs +++ b/examples/render.rs @@ -69,6 +69,7 @@ mod rustc_example { pts: 12u16 } ]; data.insert("teams".to_string(), teams.to_json()); + data.insert("engine".to_string(), "rustc_serialize".to_json()); data } } @@ -89,7 +90,6 @@ mod serde_example { data.insert("year".to_string(), value::to_value(&"2015")); - let teams = vec![ Team { name: "Jiangsu Sainty".to_string(), pts: 43u16 }, Team { name: "Beijing Guoan".to_string(), @@ -100,7 +100,9 @@ mod serde_example { pts: 12u16 } ]; data.insert("teams".to_string(), value::to_value(&teams)); + data.insert("engine".to_string(), value::to_value(&"serde_json")); data + } } diff --git a/examples/template.hbs b/examples/template.hbs index 83ae103a2..f971d81f6 100644 --- a/examples/template.hbs +++ b/examples/template.hbs @@ -12,5 +12,7 @@ {{/each~}} + +

Rendered by Handlebars from {{engine}} data.