[][src]Function classific::eq_by_ref_with

pub fn eq_by_ref_with<S, T: ?Sized, F, C>(
    map: F,
    eq: C
) -> EqByRefWith<S, T, F, C> where
    S: ?Sized,
    T: PartialEq<T>,
    F: Fn(&S) -> &T,
    C: EqClass<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")));