vortex_array/compute/
arbitrary.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4use arbitrary::{Arbitrary, Unstructured};
5
6use crate::compute::Operator;
7
8impl<'a> Arbitrary<'a> for Operator {
9    fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
10        Ok(match u.int_in_range(0..=5)? {
11            0 => Operator::Eq,
12            1 => Operator::NotEq,
13            2 => Operator::Gt,
14            3 => Operator::Gte,
15            4 => Operator::Lt,
16            5 => Operator::Lte,
17            _ => unreachable!(),
18        })
19    }
20}