提交 e5f8a3dd 编写于 作者: B bors

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.
......@@ -348,8 +348,8 @@ pub fn symmetric_difference<'a>(&'a self, other: &'a HashSet<T, S>)
/// println!("{}", x);
/// }
///
/// let diff: HashSet<_> = a.intersection(&b).cloned().collect();
/// assert_eq!(diff, [2, 3].iter().cloned().collect());
/// let intersection: HashSet<_> = a.intersection(&b).cloned().collect();
/// assert_eq!(intersection, [2, 3].iter().cloned().collect());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a, T, S> {
......@@ -373,8 +373,8 @@ pub fn intersection<'a>(&'a self, other: &'a HashSet<T, S>) -> Intersection<'a,
/// println!("{}", x);
/// }
///
/// let diff: HashSet<_> = a.union(&b).cloned().collect();
/// assert_eq!(diff, [1, 2, 3, 4].iter().cloned().collect());
/// let union: HashSet<_> = a.union(&b).cloned().collect();
/// assert_eq!(union, [1, 2, 3, 4].iter().cloned().collect());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册