summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorStjepan Glavina <stjepang@gmail.com>2017-03-22 01:42:23 +0100
committerStjepan Glavina <stjepang@gmail.com>2017-03-22 17:19:52 +0100
commitd6da1d9b46f7090b18be357bef8d55ffa3673d2f (patch)
treeb1af890ad3f0728432eec3c8049e20789b7eb75d /src/libcollections
parentcab4bff3de1a61472f3c2e7752ef54b87344d1c9 (diff)
downloadrust-d6da1d9b46f7090b18be357bef8d55ffa3673d2f.tar.gz
rust-d6da1d9b46f7090b18be357bef8d55ffa3673d2f.zip
Various fixes to wording consistency in the docs
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/binary_heap.rs4
-rw-r--r--src/libcollections/btree/map.rs4
-rw-r--r--src/libcollections/btree/set.rs2
-rw-r--r--src/libcollections/enum_set.rs2
-rw-r--r--src/libcollections/range.rs8
-rw-r--r--src/libcollections/slice.rs37
-rw-r--r--src/libcollections/str.rs2
-rw-r--r--src/libcollections/vec_deque.rs4
8 files changed, 31 insertions, 32 deletions
diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs
index 519117ff9e5..efa96ca468e 100644
--- a/src/libcollections/binary_heap.rs
+++ b/src/libcollections/binary_heap.rs
@@ -930,13 +930,13 @@ impl<'a, T> Hole<'a, T> {
         self.pos
     }
 
-    /// Return a reference to the element removed
+    /// Returns a reference to the element removed.
     #[inline]
     fn element(&self) -> &T {
         self.elt.as_ref().unwrap()
     }
 
-    /// Return a reference to the element at `index`.
+    /// Returns a reference to the element at `index`.
     ///
     /// Unsafe because index must be within the data slice and not equal to pos.
     #[inline]
diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs
index 53fe6b4bc9f..bed216ba3d1 100644
--- a/src/libcollections/btree/map.rs
+++ b/src/libcollections/btree/map.rs
@@ -526,7 +526,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
         }
     }
 
-    /// 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 the ordering
     /// on the borrowed form *must* match the ordering on the key type.
@@ -1965,7 +1965,7 @@ impl<K, V> BTreeMap<K, V> {
         self.length
     }
 
-    /// Returns true if the map contains no elements.
+    /// Returns `true` if the map contains no elements.
     ///
     /// # Examples
     ///
diff --git a/src/libcollections/btree/set.rs b/src/libcollections/btree/set.rs
index 72d25f87bca..9dbb6137937 100644
--- a/src/libcollections/btree/set.rs
+++ b/src/libcollections/btree/set.rs
@@ -415,7 +415,7 @@ impl<T: Ord> BTreeSet<T> {
         self.map.len()
     }
 
-    /// Returns true if the set contains no elements.
+    /// Returns `true` if the set contains no elements.
     ///
     /// # Examples
     ///
diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs
index 602e874aaee..e56b94b2e1e 100644
--- a/src/libcollections/enum_set.rs
+++ b/src/libcollections/enum_set.rs
@@ -106,7 +106,7 @@ impl<E: CLike> EnumSet<E> {
         self.bits.count_ones() as usize
     }
 
-    /// Returns true if the `EnumSet` is empty.
+    /// Returns `true` if the `EnumSet` is empty.
     pub fn is_empty(&self) -> bool {
         self.bits == 0
     }
diff --git a/src/libcollections/range.rs b/src/libcollections/range.rs
index 31e4d001397..d10ca087f93 100644
--- a/src/libcollections/range.rs
+++ b/src/libcollections/range.rs
@@ -20,9 +20,9 @@ use Bound::{self, Excluded, Included, Unbounded};
 /// **RangeArgument** is implemented by Rust's built-in range types, produced
 /// by range syntax like `..`, `a..`, `..b` or `c..d`.
 pub trait RangeArgument<T: ?Sized> {
-    /// Start index bound
+    /// Start index bound.
     ///
-    /// Return start value as a `Bound`
+    /// Returns start value as a `Bound`.
     ///
     /// # Examples
     ///
@@ -42,9 +42,9 @@ pub trait RangeArgument<T: ?Sized> {
     /// ```
     fn start(&self) -> Bound<&T>;
 
-    /// End index bound
+    /// End index bound.
     ///
-    /// Return end value as a `Bound`
+    /// Returns end value as a `Bound`.
     ///
     /// # Examples
     ///
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs
index 5233887620a..d3723ace9ef 100644
--- a/src/libcollections/slice.rs
+++ b/src/libcollections/slice.rs
@@ -195,7 +195,7 @@ impl<T> [T] {
         core_slice::SliceExt::is_empty(self)
     }
 
-    /// Returns the first element of a slice, or `None` if it is empty.
+    /// Returns the first element of the slice, or `None` if it is empty.
     ///
     /// # Examples
     ///
@@ -212,7 +212,7 @@ impl<T> [T] {
         core_slice::SliceExt::first(self)
     }
 
-    /// Returns a mutable pointer to the first element of a slice, or `None` if it is empty.
+    /// Returns a mutable pointer to the first element of the slice, or `None` if it is empty.
     ///
     /// # Examples
     ///
@@ -230,7 +230,7 @@ impl<T> [T] {
         core_slice::SliceExt::first_mut(self)
     }
 
-    /// Returns the first and all the rest of the elements of a slice, or `None` if it is empty.
+    /// Returns the first and all the rest of the elements of the slice, or `None` if it is empty.
     ///
     /// # Examples
     ///
@@ -248,7 +248,7 @@ impl<T> [T] {
         core_slice::SliceExt::split_first(self)
     }
 
-    /// Returns the first and all the rest of the elements of a slice, or `None` if it is empty.
+    /// Returns the first and all the rest of the elements of the slice, or `None` if it is empty.
     ///
     /// # Examples
     ///
@@ -268,7 +268,7 @@ impl<T> [T] {
         core_slice::SliceExt::split_first_mut(self)
     }
 
-    /// Returns the last and all the rest of the elements of a slice, or `None` if it is empty.
+    /// Returns the last and all the rest of the elements of the slice, or `None` if it is empty.
     ///
     /// # Examples
     ///
@@ -287,7 +287,7 @@ impl<T> [T] {
 
     }
 
-    /// Returns the last and all the rest of the elements of a slice, or `None` if it is empty.
+    /// Returns the last and all the rest of the elements of the slice, or `None` if it is empty.
     ///
     /// # Examples
     ///
@@ -307,7 +307,7 @@ impl<T> [T] {
         core_slice::SliceExt::split_last_mut(self)
     }
 
-    /// Returns the last element of a slice, or `None` if it is empty.
+    /// Returns the last element of the slice, or `None` if it is empty.
     ///
     /// # Examples
     ///
@@ -485,7 +485,7 @@ impl<T> [T] {
         core_slice::SliceExt::as_mut_ptr(self)
     }
 
-    /// Swaps two elements in a slice.
+    /// Swaps two elements in the slice.
     ///
     /// # Arguments
     ///
@@ -509,7 +509,7 @@ impl<T> [T] {
         core_slice::SliceExt::swap(self, a, b)
     }
 
-    /// Reverses the order of elements in a slice, in place.
+    /// Reverses the order of elements in the slice, in place.
     ///
     /// # Example
     ///
@@ -955,7 +955,7 @@ impl<T> [T] {
         core_slice::SliceExt::ends_with(self, needle)
     }
 
-    /// Binary search a sorted slice for a given element.
+    /// Binary searches this sorted slice for a given element.
     ///
     /// If the value is found then `Ok` is returned, containing the
     /// index of the matching element; if the value is not found then
@@ -984,7 +984,7 @@ impl<T> [T] {
         core_slice::SliceExt::binary_search(self, x)
     }
 
-    /// Binary search a sorted slice with a comparator function.
+    /// Binary searches this sorted slice with a comparator function.
     ///
     /// The comparator function should implement an order consistent
     /// with the sort order of the underlying slice, returning an
@@ -1023,7 +1023,7 @@ impl<T> [T] {
         core_slice::SliceExt::binary_search_by(self, f)
     }
 
-    /// Binary search a sorted slice with a key extraction function.
+    /// Binary searches this sorted slice with a key extraction function.
     ///
     /// Assumes that the slice is sorted by the key, for instance with
     /// [`sort_by_key`] using the same key extraction function.
@@ -1092,7 +1092,7 @@ impl<T> [T] {
         merge_sort(self, |a, b| a.lt(b));
     }
 
-    /// Sorts the slice using `compare` to compare elements.
+    /// Sorts the slice with a comparator function.
     ///
     /// This sort is stable (i.e. does not reorder equal elements) and `O(n log n)` worst-case.
     ///
@@ -1125,7 +1125,7 @@ impl<T> [T] {
         merge_sort(self, |a, b| compare(a, b) == Less);
     }
 
-    /// Sorts the slice using `f` to extract a key to compare elements by.
+    /// Sorts the slice with a key extraction function.
     ///
     /// This sort is stable (i.e. does not reorder equal elements) and `O(n log n)` worst-case.
     ///
@@ -1191,8 +1191,8 @@ impl<T> [T] {
         core_slice::SliceExt::sort_unstable(self);
     }
 
-    /// Sorts the slice using `compare` to compare elements, but may not preserve the order of
-    /// equal elements.
+    /// Sorts the slice with a comparator function, but may not preserve the order of equal
+    /// elements.
     ///
     /// This sort is unstable (i.e. may reorder equal elements), in-place (i.e. does not allocate),
     /// and `O(n log n)` worst-case.
@@ -1231,8 +1231,8 @@ impl<T> [T] {
         core_slice::SliceExt::sort_unstable_by(self, compare);
     }
 
-    /// Sorts the slice using `f` to extract a key to compare elements by, but may not preserve the
-    /// order of equal elements.
+    /// Sorts the slice with a key extraction function, but may not preserve the order of equal
+    /// elements.
     ///
     /// This sort is unstable (i.e. may reorder equal elements), in-place (i.e. does not allocate),
     /// and `O(n log n)` worst-case.
@@ -1313,7 +1313,6 @@ impl<T> [T] {
         core_slice::SliceExt::copy_from_slice(self, src)
     }
 
-
     /// Copies `self` into a new `Vec`.
     ///
     /// # Examples
diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs
index 90e54a383d6..8abc9ca7e9f 100644
--- a/src/libcollections/str.rs
+++ b/src/libcollections/str.rs
@@ -204,7 +204,7 @@ impl str {
         core_str::StrExt::len(self)
     }
 
-    /// Returns true if this slice has a length of zero bytes.
+    /// Returns `true` if `self` has a length of zero bytes.
     ///
     /// # Examples
     ///
diff --git a/src/libcollections/vec_deque.rs b/src/libcollections/vec_deque.rs
index 6a04d47a345..cb92236ec73 100644
--- a/src/libcollections/vec_deque.rs
+++ b/src/libcollections/vec_deque.rs
@@ -133,7 +133,7 @@ impl<T> VecDeque<T> {
         ptr::write(self.ptr().offset(off as isize), value);
     }
 
-    /// Returns true if and only if the buffer is at capacity
+    /// Returns `true` if and only if the buffer is at full capacity.
     #[inline]
     fn is_full(&self) -> bool {
         self.cap() - self.len() == 1
@@ -788,7 +788,7 @@ impl<T> VecDeque<T> {
         count(self.tail, self.head, self.cap())
     }
 
-    /// Returns true if the buffer contains no elements
+    /// Returns `true` if the `VecDeque` is empty.
     ///
     /// # Examples
     ///