Skip to content

Commit e5f8a3d

Browse files
committed
Auto merge of #29950 - fhahn:small-doc-fix-rename-var, r=bluss
This tiny PR renames the result variable in HashSet's `intersection` example from `diff` to `intersection` and the same for `union`, which seem more appropriate.
2 parents f8827f5 + 755caf9 commit e5f8a3d

File tree

1 file changed

+4
-4
lines changed
  • src/libstd/collections/hash

1 file changed

+4
-4
lines changed

src/libstd/collections/hash/set.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ impl<T, S> HashSet<T, S>
348348
/// println!("{}", x);
349349
/// }
350350
///
351-
/// let diff: HashSet<_> = a.intersection(&b).cloned().collect();
352-
/// assert_eq!(diff, [2, 3].iter().cloned().collect());
351+
/// let intersection: HashSet<_> = a.intersection(&b).cloned().collect();
352+
/// assert_eq!(intersection, [2, 3].iter().cloned().collect());
353353
/// ```
354354
#[stable(feature = "rust1", since = "1.0.0")]
355355
pub fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S> {
@@ -373,8 +373,8 @@ impl<T, S> HashSet<T, S>
373373
/// println!("{}", x);
374374
/// }
375375
///
376-
/// let diff: HashSet<_> = a.union(&b).cloned().collect();
377-
/// assert_eq!(diff, [1, 2, 3, 4].iter().cloned().collect());
376+
/// let union: HashSet<_> = a.union(&b).cloned().collect();
377+
/// assert_eq!(union, [1, 2, 3, 4].iter().cloned().collect());
378378
/// ```
379379
#[stable(feature = "rust1", since = "1.0.0")]
380380
pub fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S> {

0 commit comments

Comments
 (0)