From 831ffc6c09f62e0400f6331e0271bcc9f17e579f Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Thu, 10 Jun 2021 10:29:24 +0800 Subject: [PATCH] Update 'handlebars' to 4.0. --- contrib/dyn_templates/Cargo.toml | 2 +- contrib/dyn_templates/tests/templates.rs | 2 +- examples/templating/src/hbs.rs | 4 +--- examples/templating/templates/hbs/index.html.hbs | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/contrib/dyn_templates/Cargo.toml b/contrib/dyn_templates/Cargo.toml index b730b93249..d6dd21f855 100644 --- a/contrib/dyn_templates/Cargo.toml +++ b/contrib/dyn_templates/Cargo.toml @@ -32,7 +32,7 @@ optional = true [dependencies.handlebars_] package = "handlebars" -version = "3.0" +version = "4.1" optional = true [package.metadata.docs.rs] diff --git a/contrib/dyn_templates/tests/templates.rs b/contrib/dyn_templates/tests/templates.rs index bf28d06e5c..5ba42ea261 100644 --- a/contrib/dyn_templates/tests/templates.rs +++ b/contrib/dyn_templates/tests/templates.rs @@ -274,7 +274,7 @@ mod handlebars_tests { #[test] fn test_handlebars_templates() { const EXPECTED: &'static str - = "Hello _test_!\n\n
<script /> hi
\nDone.\n\n"; + = "Hello _test_!\n
<script /> hi
\nDone.\n"; let client = Client::debug(rocket()).unwrap(); let mut map = HashMap::new(); diff --git a/examples/templating/src/hbs.rs b/examples/templating/src/hbs.rs index 7d47bdb5c0..5dd3b9eaca 100644 --- a/examples/templating/src/hbs.rs +++ b/examples/templating/src/hbs.rs @@ -16,8 +16,6 @@ pub fn hello(name: &str) -> Template { title: "Hello", name: Some(name), 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) { {{/inline}} - {{~> (parent)~}} + {{> hbs/layout}} "#).expect("valid HBS template"); } diff --git a/examples/templating/templates/hbs/index.html.hbs b/examples/templating/templates/hbs/index.html.hbs index f5b778b8f4..78b237cf7e 100644 --- a/examples/templating/templates/hbs/index.html.hbs +++ b/examples/templating/templates/hbs/index.html.hbs @@ -16,4 +16,4 @@ {{/inline}} -{{~> (parent)~}} +{{> hbs/layout}}