diff options
| author | bors <bors@rust-lang.org> | 2017-07-04 15:58:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-07-04 15:58:24 +0000 |
| commit | 2fbba5bdbadeef403a64e9e1568cdad225cbcec1 (patch) | |
| tree | 5c28e75455be93fe83569947dfe602866a56e6ed /src/liballoc/vec.rs | |
| parent | de7f0617681fc94ecd0090d2dd2e4d70fea8f3a2 (diff) | |
| parent | 9cca462ca5faf348eb8a41d85193843fd6827434 (diff) | |
| download | rust-2fbba5bdbadeef403a64e9e1568cdad225cbcec1.tar.gz rust-2fbba5bdbadeef403a64e9e1568cdad225cbcec1.zip | |
Auto merge of #43051 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 8 pull requests - Successful merges: #42227, #42836, #42975, #42994, #43041, #43042, #43043, #43045 - Failed merges:
Diffstat (limited to 'src/liballoc/vec.rs')
| -rw-r--r-- | src/liballoc/vec.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index 5d1999a4262..1a5975686df 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -823,7 +823,8 @@ impl<T> Vec<T> { } } - /// Removes consecutive elements in the vector that resolve to the same key. + /// Removes all but the first of consecutive elements in the vector that resolve to the same + /// key. /// /// If the vector is sorted, this removes all duplicates. /// @@ -842,11 +843,13 @@ impl<T> Vec<T> { self.dedup_by(|a, b| key(a) == key(b)) } - /// Removes consecutive elements in the vector according to a predicate. + /// Removes all but the first of consecutive elements in the vector satisfying a given equality + /// relation. /// /// The `same_bucket` function is passed references to two elements from the vector, and - /// returns `true` if the elements compare equal, or `false` if they do not. Only the first - /// of adjacent equal items is kept. + /// returns `true` if the elements compare equal, or `false` if they do not. The elements are + /// passed in opposite order from their order in the vector, so if `same_bucket(a, b)` returns + /// `true`, `a` is removed. /// /// If the vector is sorted, this removes all duplicates. /// |
