pub fn intersection_by_key<T, L, R, K, F>(
a: L,
b: R,
key: F,
) -> impl Iterator<Item = T>Expand description
Take the intersection of two sets represented by sorted, deduplicated iterators, using a key extraction function.
See intersection().
ยงExamples
use iter_set::intersection_by_key;
let a = [(1, "a"), (2, "a")];
let b = [(2, "b"), (3, "b")];
assert!(intersection_by_key(&a, &b, |&(key, _)| key).eq(&[(2, "a")]));