rocket_dyn_templates::minijinja::tests

Function is_sameas

Source
pub fn is_sameas(value: &Value, other: &Value) -> bool
Expand description

Checks if two values are identical.

This primarily exists for compatibilith with Jinja2. It can be seen as a much stricter comparison than a regular comparison. The main difference is that values that have the same structure but a different internal object will not compare equal.

{{ [1, 2, 3] is sameas [1, 2, 3] }}
    -> false

{{ false is sameas false }}
    -> true