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.
This commit is contained in:
Matthias Krüger 2023-01-07 20:43:22 +01:00 committed by GitHub
commit ee1992c695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -317,7 +317,7 @@ impl<T, S> HashSet<T, S> {
///
/// let mut set = HashSet::from([1, 2, 3, 4, 5, 6]);
/// set.retain(|&k| k % 2 == 0);
/// assert_eq!(set.len(), 3);
/// assert_eq!(set, HashSet::from([2, 4, 6]));
/// ```
///
/// # Performance