mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user