mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-30 16:43:41 +00:00
Rollup merge of #97700 - nzrq:patch-1, r=dtolnay
Add note to documentation of HashSet::intersection The functionality of the `std::collections::HashSet::intersection(...)` method was slightly surprising to me so I wanted to take a sec to contribute to the documentation for this method. I've added a `Note:` section if that is appropriate.
This commit is contained in:
commit
c4bfd106e1
@ -588,6 +588,12 @@ where
|
||||
/// Visits the values representing the intersection,
|
||||
/// i.e., the values that are both in `self` and `other`.
|
||||
///
|
||||
/// When an equal element is present in `self` and `other`
|
||||
/// then the resulting `Intersection` may yield references to
|
||||
/// one or the other. This can be relevant if `T` contains fields which
|
||||
/// are not compared by its `Eq` implementation, and may hold different
|
||||
/// value between the two equal copies of `T` in the two sets.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
|
Loading…
Reference in New Issue
Block a user