Skip to content

Commit e66b3a2

Browse files
committed
Fix documentation for Vec::dedup_by.
The previous docstring was copied from dedup_by_key.
1 parent 6f10e2f commit e66b3a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libcollections/vec.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,11 @@ impl<T> Vec<T> {
838838
self.dedup_by(|a, b| key(a) == key(b))
839839
}
840840

841-
/// Removes consecutive elements in the vector that resolve to the same key.
841+
/// Removes consecutive elements in the vector according to a predicate.
842+
///
843+
/// The `same_bucket` function is passed references to two elements from the vector, and
844+
/// returns `true` if the elements compare equal, or `false` if they do not. Only the first
845+
/// of adjacent equal items is kept.
842846
///
843847
/// If the vector is sorted, this removes all duplicates.
844848
///

0 commit comments

Comments
 (0)