rocket_dyn_templates::minijinja::tests

Function is_in

Source
pub fn is_in(
    state: &State<'_, '_>,
    value: &Value,
    other: &Value,
) -> Result<bool, Error>
Expand description

Test version of in.

{{ 1 is in [1, 2, 3] }} -> true
{{ [1, 2, 3]|select("in", [1, 2]) }} => [1, 2]

This is useful when combined with select.