| 1 | use craterust-analyzer cargo handlebars 5.1.2 crate/::blockrust-analyzer cargo handlebars 5.1.2 block/::BlockContextrust-analyzer cargo handlebars 5.1.2 block/BlockContext#; |
| 2 | use craterust-analyzer cargo handlebars 5.1.2 crate/::jsonrust-analyzer cargo handlebars 5.1.2 json/::valuerust-analyzer cargo handlebars 5.1.2 json/value/::PathAndJsonrust-analyzer cargo handlebars 5.1.2 json/value/PathAndJson#; |
| 3 | |
| 4 | pub(craterust-analyzer cargo handlebars 5.1.2 crate/) fn create_blockrust-analyzer cargo handlebars 5.1.2 helpers/block_util/create_block().<'rc>(param: &PathAndJsonrust-analyzer cargo handlebars 5.1.2 json/value/PathAndJson#<'rc>) -> BlockContextrust-analyzer cargo handlebars 5.1.2 block/BlockContext#<'rc> { |
| 5 | let mut block = BlockContextrust-analyzer cargo handlebars 5.1.2 block/BlockContext#::newrust-analyzer cargo handlebars 5.1.2 block/impl#[`BlockContext<'rc>`]new().(); |
| 6 | |
| 7 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(new_path) = param.context_pathrust-analyzer cargo handlebars 5.1.2 json/value/impl#[`PathAndJson<'rc>`]context_path().() { |
| 8 | block.base_path_mutrust-analyzer cargo handlebars 5.1.2 block/impl#[`BlockContext<'rc>`]base_path_mut().().clone_fromrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][Clone]clone_from().(new_path) |
| 9 | } else { |
| 10 | // use clone for now |
| 11 | block.set_base_valuerust-analyzer cargo handlebars 5.1.2 block/impl#[`BlockContext<'rc>`]set_base_value().(param.valuerust-analyzer cargo handlebars 5.1.2 json/value/impl#[`PathAndJson<'rc>`]value().().clonerust-analyzer cargo serde_json 1.0.114 value/impl#[Value][Clone]clone().()); |
| 12 | } |
| 13 | |
| 14 | block |
| 15 | } |