pub const fn or(
a: impl Fn(Vector) -> Vector,
b: impl Fn(Vector) -> Vector,
) -> impl Fn(Vector) -> Vector
Expand description
Check that either condition is met
§Arguments
a
- The lhs conditionb
- The rhs condition
§Example
use swift_check::{ensure, or, eq, arch::load};
let input = b"1113331111111111";
let data = load(input);
let is_1_or_3 = ensure!(data, or(eq(b'1'), eq(b'3')));
assert!(is_1_or_3);
let input = b"!113331111111111";
let data = load(input);
let should_fail = ensure!(data, or(eq(b'1'), eq(b'3')));
assert!(!should_fail);