A potential ambiguity concerning the alternate wording and the example usage of HashSet::retain
.
#106535
Labels
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
Location
Lines 310-321 of
std/collections/hash/set.rs
Summary
The alternate (and presumably simpler) wording says
but the example usage in the doc comment would've compiled just fine even if we accidentally misread/misinterpreted that as "... returns
true
" (since the count of removed and retained items are equal):To demonstrate that exactly only the
false
elements are filtered out we could potentially change the example so that it fits better with the alternate definition:The text was updated successfully, but these errors were encountered: