fn batch_verify<V, A: Clone>(verify: &V, xs: Vec<A>) -> Vec<bool>
where
    V: Fn(&Vec<A>) -> bool,
{
    if verify(&xs) {
        xs.iter().map(|_| true).collect()
    } else {
        if xs.len() == 1 {
            return vec![false];
        } else {
            let n = xs.len();
            let n_l = n / 2;
            let l = (&xs[..n_l]).to_vec();
            let r = (&xs[n_l..]).to_vec();
            let mut l = batch_verify(verify, l);
            l.extend(batch_verify(verify, r));
            l
        }
    }
}
// In production this should be more async
In production this should be more async
In production this should be more async
fn batch_verify<V, A: Clone>(verify: &V, xs: Vec<A>) -> Vec<bool>
where
    V: Fn(&Vec<A>) -> bool,
{
    if verify(&xs) {
        xs.iter().map(|_| true).collect()
    } else {
        if xs.len() == 1 {
            return vec![false];
        } else {
            let n = xs.len();
            let n_l = n / 2;
            let l = (&xs[..n_l]).to_vec();
            let r = (&xs[n_l..]).to_vec();
            let mut l = batch_verify(verify, l);
            l.extend(batch_verify(verify, r));
            l
        }
    }
}
fn batch_verify < V , A : Clone > ( verify : & V , xs : Vec < A > ) -> Vec < bool > where V : Fn ( & Vec < A > ) -> bool , { if verify ( & xs ) { xs . iter ( ) . map ( | _ | true ) . collect ( ) } else { if xs . len ( ) == 1 { return vec ! [ false ] ; } else { let n = xs . len ( ) ; let n_l = n / 2 ; let l = ( & xs [ .. n_l ] ) . to_vec ( ) ; let r = ( & xs [ n_l .. ] ) . to_vec ( ) ; let mut l = batch_verify ( verify , l ) ; l . extend ( batch_verify ( verify , r ) ) ; l } } }
In production this should be more async
In production this should be more async
verify
&V
xs
Vec<A>