diff options
| author | Alexander Regueiro <alexreg@me.com> | 2019-02-09 22:16:58 +0000 |
|---|---|---|
| committer | Alexander Regueiro <alexreg@me.com> | 2019-02-10 23:57:25 +0000 |
| commit | 99ed06eb8864e704c4a1871ccda4648273bee4ef (patch) | |
| tree | fedfce65fa389e4fc58636bfbb9d9997656e3470 /src/libstd/collections | |
| parent | b87363e7632b3f20f9b529696ffb5d5d9c3927cd (diff) | |
| download | rust-99ed06eb8864e704c4a1871ccda4648273bee4ef.tar.gz rust-99ed06eb8864e704c4a1871ccda4648273bee4ef.zip | |
libs: doc comments
Diffstat (limited to 'src/libstd/collections')
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 14 | ||||
| -rw-r--r-- | src/libstd/collections/hash/set.rs | 4 | ||||
| -rw-r--r-- | src/libstd/collections/hash/table.rs | 12 | ||||
| -rw-r--r-- | src/libstd/collections/mod.rs | 4 |
4 files changed, 17 insertions, 17 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 91c4e990e00..beecfb1aa29 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -370,7 +370,7 @@ const DISPLACEMENT_THRESHOLD: usize = 128; /// } /// /// impl Viking { -/// /// Create a new Viking. +/// /// Creates a new Viking. /// fn new(name: &str, country: &str) -> Viking { /// Viking { name: name.to_string(), country: country.to_string() } /// } @@ -556,7 +556,7 @@ fn pop_internal<K, V>(starting_bucket: FullBucketMut<K, V>) (retkey, retval, gap.into_table()) } -/// Perform robin hood bucket stealing at the given `bucket`. You must +/// Performs robin hood bucket stealing at the given `bucket`. You must /// also pass that bucket's displacement so we don't have to recalculate it. /// /// `hash`, `key`, and `val` are the elements to "robin hood" into the hashtable. @@ -1214,7 +1214,7 @@ impl<K, V, S> HashMap<K, V, S> self.table.size() } - /// Returns true if the map contains no elements. + /// Returns `true` if the map contains no elements. /// /// # Examples /// @@ -1332,7 +1332,7 @@ impl<K, V, S> HashMap<K, V, S> self.search(k).map(|bucket| bucket.into_refs()) } - /// Returns true if the map contains a value for the specified key. + /// Returns `true` if the map contains a value for the specified key. /// /// The key may be any borrowed form of the map's key type, but /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for @@ -1896,7 +1896,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S> where S: BuildHasher, K: Eq + Hash, { - /// Create a `RawEntryMut` from the given key. + /// Creates a `RawEntryMut` from the given key. #[unstable(feature = "hash_raw_entry", issue = "56167")] pub fn from_key<Q: ?Sized>(self, k: &Q) -> RawEntryMut<'a, K, V, S> where K: Borrow<Q>, @@ -1907,7 +1907,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S> self.from_key_hashed_nocheck(hasher.finish(), k) } - /// Create a `RawEntryMut` from the given key and its hash. + /// Creates a `RawEntryMut` from the given key and its hash. #[inline] #[unstable(feature = "hash_raw_entry", issue = "56167")] pub fn from_key_hashed_nocheck<Q: ?Sized>(self, hash: u64, k: &Q) -> RawEntryMut<'a, K, V, S> @@ -1939,7 +1939,7 @@ impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S> } } } - /// Create a `RawEntryMut` from the given hash. + /// Creates a `RawEntryMut` from the given hash. #[inline] #[unstable(feature = "hash_raw_entry", issue = "56167")] pub fn from_hash<F>(self, hash: u64, is_match: F) -> RawEntryMut<'a, K, V, S> diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index c55dd049ec6..92e63df7c68 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -471,7 +471,7 @@ impl<T, S> HashSet<T, S> self.map.len() } - /// Returns true if the set contains no elements. + /// Returns `true` if the set contains no elements. /// /// # Examples /// @@ -696,7 +696,7 @@ impl<T, S> HashSet<T, S> Recover::replace(&mut self.map, value) } - /// Removes a value from the set. Returns `true` if the value was + /// Removes a value from the set. Returns whether the value was /// present in the set. /// /// The value may be any borrowed form of the set's value type, but diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 28beb80612c..9446a80a55c 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -248,11 +248,11 @@ impl<K, V, M> FullBucket<K, V, M> { pub fn into_table(self) -> M { self.table } - /// Get the raw index. + /// Gets the raw index. pub fn index(&self) -> usize { self.raw.idx } - /// Get the raw bucket. + /// Gets the raw bucket. pub fn raw(&self) -> RawBucket<K, V> { self.raw } @@ -270,7 +270,7 @@ impl<K, V, M> EmptyBucket<K, V, M> { } impl<K, V, M> Bucket<K, V, M> { - /// Get the raw index. + /// Gets the raw index. pub fn index(&self) -> usize { self.raw.idx } @@ -503,7 +503,7 @@ impl<K, V, M: Deref<Target = RawTable<K, V>>> FullBucket<K, V, M> { } } - /// Get the distance between this bucket and the 'ideal' location + /// Gets the distance between this bucket and the 'ideal' location /// as determined by the key's hash stored in it. /// /// In the cited blog posts above, this is called the "distance to @@ -839,12 +839,12 @@ impl<K, V> RawTable<K, V> { } } - /// Set the table tag + /// Sets the table tag. pub fn set_tag(&mut self, value: bool) { self.hashes.set_tag(value) } - /// Get the table tag + /// Gets the table tag. pub fn tag(&self) -> bool { self.hashes.tag() } diff --git a/src/libstd/collections/mod.rs b/src/libstd/collections/mod.rs index ef397283ca4..9ebeff48426 100644 --- a/src/libstd/collections/mod.rs +++ b/src/libstd/collections/mod.rs @@ -323,8 +323,8 @@ //! // A client of the bar. They have a blood alcohol level. //! struct Person { blood_alcohol: f32 } //! -//! // All the orders made to the bar, by client id. -//! let orders = vec![1,2,1,2,3,4,1,2,2,3,4,1,1,1]; +//! // All the orders made to the bar, by client ID. +//! let orders = vec![1, 2, 1, 2, 3, 4, 1, 2, 2, 3, 4, 1, 1, 1]; //! //! // Our clients. //! let mut blood_alcohol = BTreeMap::new(); |
