Skip to content

Commit 755caf9

Browse files
committed
Rename result variable in HashSet's intersection and union examples
1 parent 3e48b0e commit 755caf9

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)