You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Vec methods were added in rust-lang/rust#36743 but there doesn't seem to be an explanation for the choice of &mut. It does make the method slightly more general without affecting the implementation. I do not see any harm in letting the references be mutable in the iterator version. On the other hand Itertools already has the more general (both conceptually and in terms of implementation) coalesce_by() so it seems unlikely that someone would really need this feature.
First,
Itertools::dedup_by[_with_count]
usesFnMut(&Self::Item, &Self::Item) -> bool
whileVec::dedup_by
usesFnMut(&mut T, &mut T) -> bool
. It differs in mutability:&
vs&mut
. Not sure why yet.Second,
Vec::dedup_by_key
exists butItertools::dedup_by_key[_with_count]
do not:The text was updated successfully, but these errors were encountered: