Function predicates::ord::ne

source ·
pub fn ne<T>(constant: T) -> EqPredicate<T>
where T: PartialEq + Debug,
Expand description

Creates a new predicate that will return true when the given variable is not equal to a pre-defined value.

§Examples

use predicates::prelude::*;

let predicate_fn = predicate::ne(5);
assert_eq!(false, predicate_fn.eval(&5));
assert_eq!(true, predicate_fn.eval(&10));