summaryrefslogtreecommitdiffstats
path: root/vendor/handlebars/src/helpers/block_util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/handlebars/src/helpers/block_util.rs')
-rw-r--r--vendor/handlebars/src/helpers/block_util.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/handlebars/src/helpers/block_util.rs b/vendor/handlebars/src/helpers/block_util.rs
new file mode 100644
index 000000000..6971fdd8a
--- /dev/null
+++ b/vendor/handlebars/src/helpers/block_util.rs
@@ -0,0 +1,17 @@
+use crate::block::BlockContext;
+use crate::json::value::PathAndJson;
+
+pub(crate) fn create_block<'reg: 'rc, 'rc>(
+ param: &'rc PathAndJson<'reg, 'rc>,
+) -> BlockContext<'reg> {
+ let mut block = BlockContext::new();
+
+ if let Some(new_path) = param.context_path() {
+ *block.base_path_mut() = new_path.clone();
+ } else {
+ // use clone for now
+ block.set_base_value(param.value().clone());
+ }
+
+ block
+}