Function clippy_utils::search_same

source ·
pub fn search_same<T, Hash, Eq>(
    exprs: &[T],
    hash: Hash,
    eq: Eq
) -> Vec<(&T, &T)>
where Hash: Fn(&T) -> u64, Eq: Fn(&T, &T) -> bool,
Expand description

Returns list of all pairs (a, b) where eq(a, b) == true and a is before b in exprs for all a and b in exprs

Given functions eq and hash such that eq(a, b) == true implies hash(a) == hash(b)