luminos-support 0.1.0

luminos Support
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// Conditional value resolver. Evaluates one of two expressions based on the condition.
pub fn when<T, C>(
    condition: C,
    value_expr: impl IntoValueOrFn<T>,
    default_expr: impl IntoValueOrFn<T>,
) -> T
where
    C: IntoCondition,
{
    if condition.into_bool() {
        value(value_expr.into())
    } else {
        value(default_expr.into())
    }
}