polars_utils/
select.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
#[cfg(feature = "nightly")]
pub fn select_unpredictable<T>(cond: bool, true_val: T, false_val: T) -> T {
    cond.select_unpredictable(true_val, false_val)
}

#[cfg(not(feature = "nightly"))]
pub fn select_unpredictable<T>(cond: bool, true_val: T, false_val: T) -> T {
    if cond {
        true_val
    } else {
        false_val
    }
}