Function validatron::validators::is_equal
source · [−]pub fn is_equal<L, R>(value: &L, other: R) -> Result<()>where
L: PartialEq<R> + Display,
R: Display,
Expand description
Check that values are equal
assert!(is_equal(&42, 42).is_ok());
assert!(is_equal(&String::from("hello world"), "hello world").is_ok());
assert!(is_equal(&1.0, 2.0).is_err());