Function predicates::str::similar
source · pub fn similar<S>(orig: S) -> DifferencePredicatewhere
S: Into<Cow<'static, str>>,
Expand description
Creates a new Predicate
that checks strings for how similar they are.
Examples
use predicates::prelude::*;
let predicate_fn = predicate::str::similar("Hello World");
assert_eq!(true, predicate_fn.eval("Hello World"));
assert_eq!(false, predicate_fn.eval("Goodbye World"));