clippy_utils

Function search_same

source
pub fn search_same<T, Hash, Eq>(
    exprs: &[T],
    hash: Hash,
    eq: Eq,
) -> Vec<(&T, &T)>
where Hash: FnMut(&T) -> u64, Eq: FnMut(&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)