zebra_test::prelude::prop::result

Function maybe_ok

pub fn maybe_ok<T, E>(t: T, e: E) -> MaybeOk<T, E>
where T: Strategy, E: Strategy,
Expand description

Create a strategy for Results where Ok values are taken from t and Err values are taken from e.

Ok and Err are chosen with equal probability.

Generated values shrink to Err.