Skip to content

Commit 43bec83

Browse files
committed
docs: make HashSet::retain doctest more clear
1 parent 84f22e4 commit 43bec83

File tree

1 file changed

+1
-1
lines changed
  • library/std/src/collections/hash

1 file changed

+1
-1
lines changed

library/std/src/collections/hash/set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ impl<T, S> HashSet<T, S> {
317317
///
318318
/// let mut set = HashSet::from([1, 2, 3, 4, 5, 6]);
319319
/// set.retain(|&k| k % 2 == 0);
320-
/// assert_eq!(set.len(), 3);
320+
/// assert_eq!(set, HashSet::from([2, 4, 6]));
321321
/// ```
322322
///
323323
/// # Performance

0 commit comments

Comments
 (0)