diff options
| author | bors <bors@rust-lang.org> | 2015-11-20 12:30:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-11-20 12:30:00 +0000 |
| commit | e5f8a3dd028c997748ec8b903e41277102819bf4 (patch) | |
| tree | 8f6592d83020542e5eabf847a6af2e0a0f783b0f /src/libstd | |
| parent | f8827f527560a5ddea50a213440a89d3bff2bfea (diff) | |
| parent | 755caf9ff7e6ae242c48dbd28bfd6e5c3f070f97 (diff) | |
| download | rust-e5f8a3dd028c997748ec8b903e41277102819bf4.tar.gz rust-e5f8a3dd028c997748ec8b903e41277102819bf4.zip | |
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.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/set.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index 0021155b00a..daabb0f9fa8 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -348,8 +348,8 @@ impl<T, S> 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 @@ impl<T, S> HashSet<T, S> /// 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> { |
