mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
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:
commit
ee1992c695
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user