Skip to main content

all

Function all 

Source
pub fn all<T>(a: &Array<T>) -> bool
where T: Clone + PartialEq + Debug, bool: From<T>,
Expand description

Determine if all elements in an array evaluate to True

§Arguments

  • a - Input array

§Returns

true if all elements evaluate to True; false otherwise

§Example

use numrs2::prelude::*;

let a = Array::from_vec(vec![true, true, true]);
let b = Array::from_vec(vec![true, false, true]);

assert!(all(&a));
assert!(!all(&b));