about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-02-10 14:26:18 +0000
committerbors <bors@rust-lang.org>2017-02-10 14:26:18 +0000
commitbc524d3d559e7b514edec6e99feb149995db7f1d (patch)
tree7ed3b293880fce1a7e1442cd9c5de170a8eef529 /src/libstd
parentf80514426aaf59967e08f32ec44c1876cdeffe9d (diff)
parentba82a76db986589c1db38f6a256324dc2d1ad92c (diff)
downloadrust-bc524d3d559e7b514edec6e99feb149995db7f1d.tar.gz
rust-bc524d3d559e7b514edec6e99feb149995db7f1d.zip
Auto merge of #39708 - jethrogb:patch-4, r=frewsxcv
Update set operations documentation

Reminding people of set terminology.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/collections/hash/set.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs
index a3f7e13bbf9..d438aa8b3ac 100644
--- a/src/libstd/collections/hash/set.rs
+++ b/src/libstd/collections/hash/set.rs
@@ -291,7 +291,8 @@ impl<T, S> HashSet<T, S>
         Iter { iter: self.map.keys() }
     }
 
-    /// Visit the values representing the difference.
+    /// Visit the values representing the difference,
+    /// i.e. the values that are in `self` but not in `other`.
     ///
     /// # Examples
     ///
@@ -321,7 +322,8 @@ impl<T, S> HashSet<T, S>
         }
     }
 
-    /// Visit the values representing the symmetric difference.
+    /// Visit the values representing the symmetric difference,
+    /// i.e. the values that are in `self` or in `other` but not in both.
     ///
     /// # Examples
     ///
@@ -348,7 +350,8 @@ impl<T, S> HashSet<T, S>
         SymmetricDifference { iter: self.difference(other).chain(other.difference(self)) }
     }
 
-    /// Visit the values representing the intersection.
+    /// Visit the values representing the intersection,
+    /// i.e. the values that are both in `self` and `other`.
     ///
     /// # Examples
     ///
@@ -373,7 +376,8 @@ impl<T, S> HashSet<T, S>
         }
     }
 
-    /// Visit the values representing the union.
+    /// Visit the values representing the union,
+    /// i.e. all the values in `self` or `other`, without duplicates.
     ///
     /// # Examples
     ///
@@ -489,7 +493,7 @@ impl<T, S> HashSet<T, S>
         Recover::get(&self.map, value)
     }
 
-    /// Returns `true` if the set has no elements in common with `other`.
+    /// Returns `true` if `self` has no elements in common with `other`.
     /// This is equivalent to checking for an empty intersection.
     ///
     /// # Examples
@@ -511,7 +515,8 @@ impl<T, S> HashSet<T, S>
         self.iter().all(|v| !other.contains(v))
     }
 
-    /// Returns `true` if the set is a subset of another.
+    /// Returns `true` if the set is a subset of another,
+    /// i.e. `other` contains at least all the values in `self`.
     ///
     /// # Examples
     ///
@@ -532,7 +537,8 @@ impl<T, S> HashSet<T, S>
         self.iter().all(|v| other.contains(v))
     }
 
-    /// Returns `true` if the set is a superset of another.
+    /// Returns `true` if the set is a superset of another,
+    /// i.e. `self` contains at least all the values in `other`.
     ///
     /// # Examples
     ///