Rollup merge of #37215 - flodiebold:comment-fix, r=sfackler

Update comment in Vec::dedup_by

It's a tiny thing, but I came across this comment which previously was in `dedup` and wasn't updated when `dedup_by` was introduced.
This commit is contained in:
Guillaume Gomez
2016-10-17 23:07:53 +02:00
committed by GitHub
+1 -1
View File
@@ -822,7 +822,7 @@ pub fn dedup_by_key<F, K>(&mut self, mut key: F) where F: FnMut(&mut T) -> K, K:
pub fn dedup_by<F>(&mut self, mut same_bucket: F) where F: FnMut(&mut T, &mut T) -> bool {
unsafe {
// Although we have a mutable reference to `self`, we cannot make
// *arbitrary* changes. The `PartialEq` comparisons could panic, so we
// *arbitrary* changes. The `same_bucket` calls could panic, so we
// must ensure that the vector is in a valid state at all time.
//
// The way that we handle this is by using swaps; we iterate