mirror of https://github.com/rwf2/Rocket.git
Update 'handlebars' to 4.0.
This commit is contained in:
parent
f38cbea898
commit
831ffc6c09
|
@ -32,7 +32,7 @@ optional = true
|
||||||
|
|
||||||
[dependencies.handlebars_]
|
[dependencies.handlebars_]
|
||||||
package = "handlebars"
|
package = "handlebars"
|
||||||
version = "3.0"
|
version = "4.1"
|
||||||
optional = true
|
optional = true
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
|
|
|
@ -274,7 +274,7 @@ mod handlebars_tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_handlebars_templates() {
|
fn test_handlebars_templates() {
|
||||||
const EXPECTED: &'static str
|
const EXPECTED: &'static str
|
||||||
= "Hello _test_!\n\n<main> <script /> hi </main>\nDone.\n\n";
|
= "Hello _test_!\n<main> <script /> hi </main>\nDone.\n";
|
||||||
|
|
||||||
let client = Client::debug(rocket()).unwrap();
|
let client = Client::debug(rocket()).unwrap();
|
||||||
let mut map = HashMap::new();
|
let mut map = HashMap::new();
|
||||||
|
|
|
@ -16,8 +16,6 @@ pub fn hello(name: &str) -> Template {
|
||||||
title: "Hello",
|
title: "Hello",
|
||||||
name: Some(name),
|
name: Some(name),
|
||||||
items: vec!["One", "Two", "Three"],
|
items: vec!["One", "Two", "Three"],
|
||||||
// This special key tells handlebars which template is the parent.
|
|
||||||
parent: "hbs/layout",
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +60,6 @@ pub fn customize(hbs: &mut Handlebars) {
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{/inline}}
|
{{/inline}}
|
||||||
{{~> (parent)~}}
|
{{> hbs/layout}}
|
||||||
"#).expect("valid HBS template");
|
"#).expect("valid HBS template");
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{/inline}}
|
{{/inline}}
|
||||||
{{~> (parent)~}}
|
{{> hbs/layout}}
|
||||||
|
|
Loading…
Reference in New Issue