Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ee1992c

Browse files
authoredJan 7, 2023
Rollup merge of #106553 - Ezrashaw:fix-hashset-doctest, r=JohnTitor
docs: make `HashSet::retain` doctest more clear Fixes #106535 Extremely simple fix suggested by ``@compiler-errors`` in the linked issue.
2 parents 1e6710d + 43bec83 commit ee1992c

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)
Please sign in to comment.