[][src]Function classific::eq_by_ref

pub fn eq_by_ref<S, T: ?Sized, F>(map: F) -> EqByRef<S, T, F> where
    S: ?Sized,
    T: PartialEq<T>,
    F: Fn(&S) -> &T, 

This function returns an EqClass for S which first maps values to &T then compare them with PartialEq::eq.

Examples

use classific::{EqClass, eq_by_ref};

assert!(eq_by_ref(|t: &(i8, &'static str)| &t.1).eq(&(1, "2"), &(3, "2")));