Current:
fn linear_group_by_key<F, K>(&self, func: F) -> LinearGroupByKey<T, F>
where F: FnMut(&T) -> K,
K: PartialEq
Does not allow:
let strings = vec!["A".to_owned()];
strings.linear_group_by_key(|s| s.as_str());
In order for that to work, we need:
fn linear_group_by_key<'a, F, K>(&'a self, func: F) -> LinearGroupByKey<T, F>
where F: FnMut(&'a T) -> K,
K: PartialEq
Since nothing moves in memory it should be possible.