Rollup merge of #40536 - kevinmehall:dedup_docs_for_dedup_by, r=steveklabnik

Fix documentation for Vec::dedup_by.

The previous docstring was copied from dedup_by_key.
This commit is contained in:
Corey Farwell 2017-03-17 08:49:08 -04:00 committed by GitHub
commit dc1deeb9b4
1 changed files with 5 additions and 1 deletions

View File

@ -838,7 +838,11 @@ impl<T> Vec<T> {
self.dedup_by(|a, b| key(a) == key(b))
}
/// Removes consecutive elements in the vector that resolve to the same key.
/// Removes consecutive elements in the vector according to a predicate.
///
/// 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.
///
/// If the vector is sorted, this removes all duplicates.
///