Function dilla_renderer::renderable::add_attr_to_json_element
source · pub fn add_attr_to_json_element(
v: &Value,
name: String,
value: Option<Value>
) -> Value
Expand description
Adds an attribute to a JSON element.
Arguments
v
- A reference to theminijinja::Value
that will be converted to a map and modified.name
- The name of the attribute to be added to the JSON element.value
- The value of the attribute to be added. IfNone
, an empty string will be added.
Returns
minijinja::Value
- The modified JSON element with the new attribute added.