diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:06:37 +0000 |
commit | 246f239d9f40f633160f0c18f87a20922d4e77bb (patch) | |
tree | 5a88572663584b3d4d28e5a20e10abab1be40884 /vendor/handlebars/src/helpers/helper_with.rs | |
parent | Releasing progress-linux version 1.64.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.tar.xz rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.zip |
Merging debian version 1.65.0+dfsg1-2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/handlebars/src/helpers/helper_with.rs')
-rw-r--r-- | vendor/handlebars/src/helpers/helper_with.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/vendor/handlebars/src/helpers/helper_with.rs b/vendor/handlebars/src/helpers/helper_with.rs index c4d31cd0e..2ea6bd4f6 100644 --- a/vendor/handlebars/src/helpers/helper_with.rs +++ b/vendor/handlebars/src/helpers/helper_with.rs @@ -25,7 +25,7 @@ impl HelperDef for WithHelper { .ok_or_else(|| RenderError::new("Param not found for helper \"with\""))?; if param.value().is_truthy(false) { - let mut block = create_block(¶m); + let mut block = create_block(param); if let Some(block_param) = h.block_param() { let mut params = BlockParams::new(); @@ -60,7 +60,6 @@ pub static WITH_HELPER: WithHelper = WithHelper; #[cfg(test)] mod test { - use crate::json::value::to_json; use crate::registry::Registry; #[derive(Serialize)] @@ -211,12 +210,12 @@ mod test { assert!(handlebars .register_template_string("t0", "{{#with a}}{{#with b}}{{../../d}}{{/with}}{{/with}}") .is_ok()); - let data = btreemap! { - "a".to_string() => to_json(&btreemap! { - "b".to_string() => vec![btreemap!{"c".to_string() => vec![1]}] - }), - "d".to_string() => to_json(1) - }; + let data = json!({ + "a": { + "b": [{"c": [1]}] + }, + "d": 1 + }); let r0 = handlebars.render("t0", &data); assert_eq!(r0.ok().unwrap(), "1".to_string()); |