Skip to content

Commit

Permalink
Rollup merge of rust-lang#106553 - Ezrashaw:fix-hashset-doctest, r=Jo…
Browse files Browse the repository at this point in the history
…hnTitor

docs: make `HashSet::retain` doctest more clear

Fixes rust-lang#106535

Extremely simple fix suggested by `@compiler-errors` in the linked issue.
  • Loading branch information
matthiaskrgr authored Jan 7, 2023
2 parents 07a47a3 + 43bec83 commit e33c22c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e33c22c

Please sign in to comment.