Update comment in Vec::dedup_by

This commit is contained in:
Florian Diebold 2016-10-16 14:40:56 +02:00
parent 6dc035ed91
commit 187ddf30b0

View File

@ -822,7 +822,7 @@ impl<T> Vec<T> {
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