[][src]Function tract_tensorflow::prelude::tract_itertools::all

pub fn all<I, F>(iterable: I, f: F) -> bool where
    F: FnMut(<I as IntoIterator>::Item) -> bool,
    I: IntoIterator

Test whether the predicate holds for all elements in the iterable.

IntoIterator enabled version of i.all(f)

use itertools::all;

assert!(all(&[1, 2, 3], |elt| *elt > 0));