]> git.lizzy.rs Git - rust.git/commitdiff
Change 'Example' to 'Examples' throughout collections' rustdocs.
authorjbranchaud <jbranchaud@gmail.com>
Tue, 9 Dec 2014 05:28:07 +0000 (23:28 -0600)
committerjbranchaud <jbranchaud@gmail.com>
Tue, 9 Dec 2014 05:28:07 +0000 (23:28 -0600)
16 files changed:
src/libcollections/binary_heap.rs
src/libcollections/bit.rs
src/libcollections/btree/map.rs
src/libcollections/btree/set.rs
src/libcollections/dlist.rs
src/libcollections/hash/mod.rs
src/libcollections/ring_buf.rs
src/libcollections/slice.rs
src/libcollections/str.rs
src/libcollections/string.rs
src/libcollections/tree/map.rs
src/libcollections/tree/set.rs
src/libcollections/trie/map.rs
src/libcollections/trie/set.rs
src/libcollections/vec.rs
src/libcollections/vec_map.rs

index e321ef16f66b5b623424d41a5395ff9cc8e19c87..347300e25aded37d74b990f60f13ba8992b3405a 100644 (file)
@@ -15,7 +15,7 @@
 //! complexity. A priority queue can also be converted to a sorted vector in-place, allowing it to
 //! be used for an `O(n log n)` in-place heapsort.
 //!
-//! # Example
+//! # Examples
 //!
 //! This is a larger example which implements [Dijkstra's algorithm][dijkstra]
 //! to solve the [shortest path problem][sssp] on a [directed graph][dir_graph].
@@ -178,7 +178,7 @@ fn default() -> BinaryHeap<T> { BinaryHeap::new() }
 impl<T: Ord> BinaryHeap<T> {
     /// Creates an empty `BinaryHeap` as a max-heap.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -192,7 +192,7 @@ pub fn new() -> BinaryHeap<T> { BinaryHeap{data: vec!(),} }
     /// so that the `BinaryHeap` does not have to be reallocated
     /// until it contains at least that many values.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -206,7 +206,7 @@ pub fn with_capacity(capacity: uint) -> BinaryHeap<T> {
     /// Creates a `BinaryHeap` from a vector. This is sometimes called
     /// `heapifying` the vector.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -225,7 +225,7 @@ pub fn from_vec(xs: Vec<T>) -> BinaryHeap<T> {
     /// An iterator visiting all values in underlying vector, in
     /// arbitrary order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -245,7 +245,7 @@ pub fn iter<'a>(&'a self) -> Items<'a, T> {
     /// the binary heap in arbitrary order.  The binary heap cannot be used
     /// after calling this.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -264,7 +264,7 @@ pub fn into_iter(self) -> MoveItems<T> {
 
     /// Returns the greatest item in a queue, or `None` if it is empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -284,7 +284,7 @@ pub fn top<'a>(&'a self) -> Option<&'a T> {
 
     /// Returns the number of elements the queue can hold without reallocating.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -306,7 +306,7 @@ pub fn capacity(&self) -> uint { self.data.capacity() }
     ///
     /// Panics if the new capacity overflows `uint`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -325,7 +325,7 @@ pub fn reserve_exact(&mut self, additional: uint) { self.data.reserve_exact(addi
     ///
     /// Panics if the new capacity overflows `uint`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -348,7 +348,7 @@ pub fn shrink_to_fit(&mut self) {
     /// Removes the greatest item from a queue and returns it, or `None` if it
     /// is empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -375,7 +375,7 @@ pub fn pop(&mut self) -> Option<T> {
 
     /// Pushes an item onto the queue.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -398,7 +398,7 @@ pub fn push(&mut self, item: T) {
     /// Pushes an item onto a queue then pops the greatest item off the queue in
     /// an optimized fashion.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -424,7 +424,7 @@ pub fn push_pop(&mut self, mut item: T) -> T {
     /// an optimized fashion. The push is done regardless of whether the queue
     /// was empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -450,7 +450,7 @@ pub fn replace(&mut self, mut item: T) -> Option<T> {
     /// Consumes the `BinaryHeap` and returns the underlying vector
     /// in arbitrary order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
@@ -468,7 +468,7 @@ pub fn replace(&mut self, mut item: T) -> Option<T> {
     /// Consumes the `BinaryHeap` and returns a vector in sorted
     /// (ascending) order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BinaryHeap;
index ad5732c47a891b88dbb07497fba8ad9d8e46954c..b401978c9c9cd1bd25fae1949e50e89b55561f06 100644 (file)
@@ -13,7 +13,7 @@
 
 //! Collections implemented with bit vectors.
 //!
-//! # Example
+//! # Examples
 //!
 //! This is a simple example of the [Sieve of Eratosthenes][sieve]
 //! which calculates prime numbers up to a given limit.
@@ -101,7 +101,7 @@ fn match_words <'a,'b>(a: &'a Bitv, b: &'b Bitv) -> (MatchWords<'a>, MatchWords<
 
 /// The bitvector type.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```rust
 /// use collections::Bitv;
@@ -214,7 +214,7 @@ fn mask_words<'a>(&'a self, mut start: uint) -> MaskWords<'a> {
 
     /// Creates an empty `Bitv`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::Bitv;
@@ -228,7 +228,7 @@ pub fn new() -> Bitv {
     /// Creates a `Bitv` that holds `nbits` elements, setting each element
     /// to `init`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::Bitv;
@@ -262,7 +262,7 @@ pub fn with_capacity(nbits: uint, init: bool) -> Bitv {
     ///
     /// Panics if `i` is out of bounds.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -289,7 +289,7 @@ pub fn get(&self, i: uint) -> bool {
     ///
     /// Panics if `i` is out of bounds.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::Bitv;
@@ -311,7 +311,7 @@ pub fn set(&mut self, i: uint, x: bool) {
 
     /// Sets all bits to 1.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -330,7 +330,7 @@ pub fn set_all(&mut self) {
 
     /// Flips all bits.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -357,7 +357,7 @@ pub fn negate(&mut self) {
     ///
     /// Panics if the bitvectors are of different lengths.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -387,7 +387,7 @@ pub fn union(&mut self, other: &Bitv) -> bool {
     ///
     /// Panics if the bitvectors are of different lengths.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -417,7 +417,7 @@ pub fn intersect(&mut self, other: &Bitv) -> bool {
     ///
     /// Panics if the bitvectors are of different length.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -446,7 +446,7 @@ pub fn difference(&mut self, other: &Bitv) -> bool {
 
     /// Returns `true` if all bits are 1.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::Bitv;
@@ -469,7 +469,7 @@ pub fn all(&self) -> bool {
 
     /// Returns an iterator over the elements of the vector in order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -484,7 +484,7 @@ pub fn iter<'a>(&'a self) -> Bits<'a> {
 
     /// Returns `true` if all bits are 0.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::Bitv;
@@ -501,7 +501,7 @@ pub fn none(&self) -> bool {
 
     /// Returns `true` if any bit is 1.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::Bitv;
@@ -522,7 +522,7 @@ pub fn any(&self) -> bool {
     /// size of the `Bitv` is not a multiple of eight then trailing bits
     /// will be filled-in with `false`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::Bitv;
@@ -564,7 +564,7 @@ fn bit (bitv: &Bitv, byte: uint, bit: uint) -> u8 {
 
     /// Transforms `self` into a `Vec<bool>` by turning each bit into a `bool`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -584,7 +584,7 @@ pub fn to_bools(&self) -> Vec<bool> {
     ///
     /// Panics if the `Bitv` and slice are of different length.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -609,7 +609,7 @@ pub fn eq_vec(&self, v: &[bool]) -> bool {
     /// If `len` is greater than the vector's current length, this has no
     /// effect.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -633,7 +633,7 @@ pub fn truncate(&mut self, len: uint) {
 
     /// Grows the vector to be able to store `size` bits without resizing.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::Bitv;
@@ -654,7 +654,7 @@ pub fn reserve(&mut self, size: uint) {
     /// Returns the capacity in bits for this bit vector. Inserting any
     /// element less than this amount will not trigger a resizing.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::Bitv;
@@ -670,7 +670,7 @@ pub fn capacity(&self) -> uint {
 
     /// Grows the `Bitv` in-place, adding `n` copies of `value` to the `Bitv`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -722,7 +722,7 @@ pub fn grow(&mut self, n: uint, value: bool) {
     ///
     /// Assert if empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::bitv;
@@ -745,7 +745,7 @@ pub fn pop(&mut self) -> bool {
 
     /// Pushes a `bool` onto the end.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::Bitv;
@@ -786,7 +786,7 @@ pub fn clear(&mut self) {
 /// with the most significant bits of each byte coming first. Each
 /// bit becomes `true` if equal to 1 or `false` if equal to 0.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```
 /// use std::collections::bitv;
@@ -808,7 +808,7 @@ pub fn from_bytes(bytes: &[u8]) -> Bitv {
 /// Creates a `Bitv` of the specified length where the value at each
 /// index is `f(index)`.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```
 /// use std::collections::bitv::from_fn;
@@ -968,7 +968,7 @@ fn idx(&mut self, index: uint) -> Option<bool> {
 /// set of objects is proportional to the maximum of the objects when viewed
 /// as a `uint`.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```
 /// use std::collections::{BitvSet, Bitv};
@@ -1053,7 +1053,7 @@ impl cmp::Eq for BitvSet {}
 impl BitvSet {
     /// Creates a new bit vector set with initially no contents.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1068,7 +1068,7 @@ pub fn new() -> BitvSet {
     /// Creates a new bit vector set with initially no contents, able to
     /// hold `nbits` elements without resizing.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1084,7 +1084,7 @@ pub fn with_capacity(nbits: uint) -> BitvSet {
 
     /// Creates a new bit vector set from the given bit vector.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::{bitv, BitvSet};
@@ -1107,7 +1107,7 @@ pub fn from_bitv(mut bitv: Bitv) -> BitvSet {
     /// Returns the capacity in bits for this bit vector. Inserting any
     /// element less than this amount will not trigger a resizing.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1124,7 +1124,7 @@ pub fn capacity(&self) -> uint {
 
     /// Grows the underlying vector to be able to store `size` bits.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1143,7 +1143,7 @@ pub fn reserve(&mut self, size: uint) {
 
     /// Consumes this set to return the underlying bit vector.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1164,7 +1164,7 @@ pub fn into_bitv(self) -> Bitv {
 
     /// Returns a reference to the underlying bit vector.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1206,7 +1206,7 @@ fn other_op(&mut self, other: &BitvSet, f: |u32, u32| -> u32) {
 
     /// Truncates the underlying vector to the least length required.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1238,7 +1238,7 @@ pub fn shrink_to_fit(&mut self) {
 
     /// Iterator over each u32 stored in the `BitvSet`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1260,7 +1260,7 @@ pub fn iter<'a>(&'a self) -> BitPositions<'a> {
     /// Iterator over each u32 stored in `self` union `other`.
     /// See [union_with](#method.union_with) for an efficient in-place version.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1289,7 +1289,7 @@ pub fn union<'a>(&'a self, other: &'a BitvSet) -> TwoBitPositions<'a> {
     /// Iterator over each uint stored in `self` intersect `other`.
     /// See [intersect_with](#method.intersect_with) for an efficient in-place version.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1319,7 +1319,7 @@ pub fn intersection<'a>(&'a self, other: &'a BitvSet) -> Take<TwoBitPositions<'a
     /// Iterator over each uint stored in the `self` setminus `other`.
     /// See [difference_with](#method.difference_with) for an efficient in-place version.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1356,7 +1356,7 @@ pub fn difference<'a>(&'a self, other: &'a BitvSet) -> TwoBitPositions<'a> {
     /// See [symmetric_difference_with](#method.symmetric_difference_with) for
     /// an efficient in-place version.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1384,7 +1384,7 @@ pub fn symmetric_difference<'a>(&'a self, other: &'a BitvSet) -> TwoBitPositions
 
     /// Unions in-place with the specified other bit vector.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1408,7 +1408,7 @@ pub fn union_with(&mut self, other: &BitvSet) {
 
     /// Intersects in-place with the specified other bit vector.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1433,7 +1433,7 @@ pub fn intersect_with(&mut self, other: &BitvSet) {
     /// Makes this bit vector the difference with the specified other bit vector
     /// in-place.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
@@ -1466,7 +1466,7 @@ pub fn difference_with(&mut self, other: &BitvSet) {
     /// Makes this bit vector the symmetric difference with the specified other
     /// bit vector in-place.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BitvSet;
index b3dc9139eb32462687778072af23c630794ceeb7..9d2b3f3bb709783d473efdcddde95d3ce3653833 100644 (file)
@@ -152,7 +152,7 @@ pub fn with_b(b: uint) -> BTreeMap<K, V> {
 
     /// Clears the map, removing all values.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeMap;
@@ -188,7 +188,7 @@ pub fn find(&self, key: &K) -> Option<&V> {
     /// 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.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeMap;
@@ -220,7 +220,7 @@ pub fn get<Sized? Q>(&self, key: &Q) -> Option<&V> where Q: BorrowFrom<K> + Ord
     /// 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.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeMap;
@@ -246,7 +246,7 @@ pub fn find_mut(&mut self, key: &K) -> Option<&mut V> {
     /// 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.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeMap;
@@ -314,7 +314,7 @@ pub fn swap(&mut self, key: K, value: V) -> Option<V> {
     /// Inserts a key-value pair from the map. If the key already had a value
     /// present in the map, that value is returned. Otherwise, `None` is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeMap;
@@ -423,7 +423,7 @@ pub fn pop(&mut self, key: &K) -> Option<V> {
     /// 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.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeMap;
@@ -1069,7 +1069,7 @@ pub fn into_iter(self) -> MoveEntries<K, V> {
 
     /// Gets an iterator over the keys of the map.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeMap;
@@ -1088,7 +1088,7 @@ pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
 
     /// Gets an iterator over the values of the map.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeMap;
@@ -1107,7 +1107,7 @@ pub fn values<'a>(&'a self) -> Values<'a, K, V> {
 
     /// Return the number of elements in the map.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeMap;
@@ -1122,7 +1122,7 @@ pub fn len(&self) -> uint { self.length }
 
     /// Return true if the map contains no elements.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeMap;
index 573b5a9422b84be9cb3badfa351432de67668417..2f9c383660441a8d7fc47b4b09ad8b1da2b81105 100644 (file)
@@ -95,7 +95,7 @@ pub fn into_iter(self) -> MoveItems<T> {
 impl<T: Ord> BTreeSet<T> {
     /// Visits the values representing the difference, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -118,7 +118,7 @@ pub fn difference<'a>(&'a self, other: &'a BTreeSet<T>) -> DifferenceItems<'a, T
 
     /// Visits the values representing the symmetric difference, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -142,7 +142,7 @@ pub fn symmetric_difference<'a>(&'a self, other: &'a BTreeSet<T>)
 
     /// Visits the values representing the intersection, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -166,7 +166,7 @@ pub fn intersection<'a>(&'a self, other: &'a BTreeSet<T>)
 
     /// Visits the values representing the union, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -187,7 +187,7 @@ pub fn union<'a>(&'a self, other: &'a BTreeSet<T>) -> UnionItems<'a, T> {
 
     /// Return the number of elements in the set
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -202,7 +202,7 @@ pub fn len(&self) -> uint { self.map.len() }
 
     /// Returns true if the set contains no elements
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -217,7 +217,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
 
     /// Clears the set, removing all values.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -238,7 +238,7 @@ pub fn clear(&mut self) {
     /// but the ordering on the borrowed form *must* match the
     /// ordering on the value type.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -255,7 +255,7 @@ pub fn contains<Sized? Q>(&self, value: &Q) -> bool where Q: BorrowFrom<T> + Ord
     /// Returns `true` if the set has no elements in common with `other`.
     /// This is equivalent to checking for an empty intersection.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -276,7 +276,7 @@ pub fn is_disjoint(&self, other: &BTreeSet<T>) -> bool {
 
     /// Returns `true` if the set is a subset of another.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -318,7 +318,7 @@ pub fn is_subset(&self, other: &BTreeSet<T>) -> bool {
 
     /// Returns `true` if the set is a superset of another.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -343,7 +343,7 @@ pub fn is_superset(&self, other: &BTreeSet<T>) -> bool {
     /// Adds a value to the set. Returns `true` if the value was not already
     /// present in the set.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
@@ -366,7 +366,7 @@ pub fn insert(&mut self, value: T) -> bool {
     /// but the ordering on the borrowed form *must* match the
     /// ordering on the value type.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::BTreeSet;
index a30bb9e978b508c6644acd6826bf63c1b8c66058..f8492f493d19b08b0e8f88f66eed125044d7165d 100644 (file)
@@ -204,7 +204,7 @@ pub fn new() -> DList<T> {
     ///
     /// If the list is empty, does nothing.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::DList;
@@ -231,7 +231,7 @@ pub fn rotate_forward(&mut self) {
     ///
     /// If the list is empty, does nothing.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::DList;
@@ -258,7 +258,7 @@ pub fn rotate_backward(&mut self) {
     ///
     /// This operation should compute in O(1) time.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::DList;
@@ -299,7 +299,7 @@ pub fn append(&mut self, mut other: DList<T>) {
     ///
     /// This operation should compute in O(1) time.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::DList;
@@ -328,7 +328,7 @@ pub fn prepend(&mut self, mut other: DList<T>) {
     ///
     /// This operation should compute in O(N) time.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::DList;
@@ -500,7 +500,7 @@ pub fn push(&mut self, elt: T) {
 
     /// Appends an element to the back of a list
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::DList;
@@ -524,7 +524,7 @@ pub fn pop(&mut self) -> Option<T> {
     /// Removes the last element from a list and returns it, or `None` if
     /// it is empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::DList;
index 1dc2539c592e9d68564aaa26055ff39f4b750437..637541a8fd654a5d56e0bd2983ffb159079e4373 100644 (file)
@@ -13,7 +13,7 @@
 //! This module provides a generic way to compute the hash of a value. The
 //! simplest way to make a type hashable is to use `#[deriving(Hash)]`:
 //!
-//! # Example
+//! # Examples
 //!
 //! ```rust
 //! use std::hash;
index d9e5dde96ceee7693be941db311b068b517dc98b..95207cbf205e0ad9501beacf0ad2955678f41caa 100644 (file)
@@ -137,7 +137,7 @@ pub fn with_capacity(n: uint) -> RingBuf<T> {
 
     /// Retrieves an element in the `RingBuf` by index.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::RingBuf;
@@ -160,7 +160,7 @@ pub fn get(&self, i: uint) -> Option<&T> {
 
     /// Retrieves an element in the `RingBuf` mutably by index.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::RingBuf;
@@ -194,7 +194,7 @@ pub fn get_mut(&mut self, i: uint) -> Option<&mut T> {
     ///
     /// Fails if there is no element with either index.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::RingBuf;
@@ -220,7 +220,7 @@ pub fn swap(&mut self, i: uint, j: uint) {
     /// Returns the number of elements the `RingBuf` can hold without
     /// reallocating.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -243,7 +243,7 @@ pub fn capacity(&self) -> uint { self.cap - 1 }
     ///
     /// Panics if the new capacity overflows `uint`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -264,7 +264,7 @@ pub fn reserve_exact(&mut self, additional: uint) {
     ///
     /// Panics if the new capacity overflows `uint`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -342,7 +342,7 @@ pub fn reserve(&mut self, additional: uint) {
 
     /// Returns a front-to-back iterator.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::RingBuf;
@@ -365,7 +365,7 @@ pub fn iter(&self) -> Items<T> {
 
     /// Returns a front-to-back iterator which returns mutable references.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::RingBuf;
@@ -402,7 +402,7 @@ pub fn into_iter(self) -> MoveItems<T> {
 
     /// Returns the number of elements in the `RingBuf`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -417,7 +417,7 @@ pub fn len(&self) -> uint { count(self.tail, self.head, self.cap) }
 
     /// Returns true if the buffer contains no elements
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -432,7 +432,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
 
     /// Clears the buffer, removing all values.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -452,7 +452,7 @@ pub fn clear(&mut self) {
     /// Provides a reference to the front element, or `None` if the sequence is
     /// empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -472,7 +472,7 @@ pub fn front(&self) -> Option<&T> {
     /// Provides a mutable reference to the front element, or `None` if the
     /// sequence is empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -496,7 +496,7 @@ pub fn front_mut(&mut self) -> Option<&mut T> {
     /// Provides a reference to the back element, or `None` if the sequence is
     /// empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -516,7 +516,7 @@ pub fn back(&self) -> Option<&T> {
     /// Provides a mutable reference to the back element, or `None` if the
     /// sequence is empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -541,7 +541,7 @@ pub fn back_mut(&mut self) -> Option<&mut T> {
     /// Removes the first element and returns it, or `None` if the sequence is
     /// empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -567,7 +567,7 @@ pub fn pop_front(&mut self) -> Option<T> {
 
     /// Inserts an element first in the sequence.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::RingBuf;
@@ -597,7 +597,7 @@ pub fn push(&mut self, t: T) {
 
     /// Appends an element to the back of a buffer
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::RingBuf;
@@ -628,7 +628,7 @@ pub fn pop(&mut self) -> Option<T> {
     /// Removes the last element from a buffer and returns it, or `None` if
     /// it is empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// use std::collections::RingBuf;
index 03b8ea8f20fa5de6002dc79c5e54338f24aaff73..96d3ecb4d679d33cf96fa5702129fcb93cc269cc 100644 (file)
@@ -297,7 +297,7 @@ pub trait CloneSliceAllocPrelude<T> for Sized? {
     /// Creates an iterator that yields every possible permutation of the
     /// vector in succession.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let v = [1i, 2, 3];
@@ -308,7 +308,7 @@ pub trait CloneSliceAllocPrelude<T> for Sized? {
     /// }
     /// ```
     ///
-    /// # Example 2: iterating through permutations one by one.
+    /// Iterating through permutations one by one.
     ///
     /// ```rust
     /// let v = [1i, 2, 3];
@@ -567,7 +567,7 @@ pub trait OrdSliceAllocPrelude<T> for Sized? {
     ///
     /// This is equivalent to `self.sort_by(|a, b| a.cmp(b))`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let mut v = [-5i, 4, 1, -3, 2];
@@ -596,7 +596,7 @@ pub trait SliceAllocPrelude<T> for Sized? {
     /// This sort is `O(n log n)` worst-case and stable, but allocates
     /// approximately `2 * n`, where `n` is the length of `self`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let mut v = [5i, 4, 1, 3, 2];
@@ -621,7 +621,7 @@ pub trait SliceAllocPrelude<T> for Sized? {
     /// * start - The index into `src` to start copying from
     /// * end - The index into `src` to stop copying from
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let mut a = [1i, 2, 3, 4, 5];
index 28027198143f0e847115bf4076bf80f3921ac82b..3195d76d98899986a7c53cc2b3c4d02233719feb 100644 (file)
@@ -93,7 +93,7 @@
 pub trait StrVector for Sized? {
     /// Concatenates a vector of strings.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let first = "Restaurant at the End of the".to_string();
@@ -105,7 +105,7 @@ pub trait StrVector for Sized? {
 
     /// Concatenates a vector of strings, placing a given separator between each.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let first = "Roast".to_string();
@@ -382,7 +382,7 @@ fn next(&mut self) -> Option<char> {
 ///
 /// The original string with all occurrences of `from` replaced with `to`.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```rust
 /// use std::str;
@@ -440,7 +440,7 @@ pub enum MaybeOwned<'a> {
 impl<'a> MaybeOwned<'a> {
     /// Returns `true` if this `MaybeOwned` wraps an owned string.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ``` ignore
     /// let string = String::from_str("orange");
@@ -457,7 +457,7 @@ pub fn is_owned(&self) -> bool {
 
     /// Returns `true` if this `MaybeOwned` wraps a borrowed string.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ``` ignore
     /// let string = "orange";
@@ -492,7 +492,7 @@ pub trait IntoMaybeOwned<'a> {
 #[deprecated = "use std::borrow::IntoCow"]
 #[allow(deprecated)]
 impl<'a> IntoMaybeOwned<'a> for String {
-    /// # Example
+    /// # Examples
     ///
     /// ``` ignore
     /// let owned_string = String::from_str("orange");
@@ -509,7 +509,7 @@ fn into_maybe_owned(self) -> MaybeOwned<'a> {
 #[deprecated = "use std::borrow::IntoCow"]
 #[allow(deprecated)]
 impl<'a> IntoMaybeOwned<'a> for &'a str {
-    /// # Example
+    /// # Examples
     ///
     /// ``` ignore
     /// let string = "orange";
@@ -524,7 +524,7 @@ fn into_maybe_owned(self) -> MaybeOwned<'a> { Slice(self) }
 #[allow(deprecated)]
 #[deprecated = "use std::borrow::IntoCow"]
 impl<'a> IntoMaybeOwned<'a> for MaybeOwned<'a> {
-    /// # Example
+    /// # Examples
     ///
     /// ``` ignore
     /// let str = "orange";
@@ -708,7 +708,7 @@ fn escape_unicode(&self) -> String {
     ///
     /// The original string with all occurrences of `from` replaced with `to`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let s = "Do you know the muffin man,
index 571f3fa468589967cadf7ad9b0d1543fd1866e84..bad7b069df22a11e859dfe90f40d44921ac64bbb 100644 (file)
@@ -39,7 +39,7 @@ pub struct String {
 impl String {
     /// Creates a new string buffer initialized with the empty string.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::new();
@@ -56,7 +56,7 @@ pub fn new() -> String {
     /// The string will be able to hold exactly `capacity` bytes without
     /// reallocating. If `capacity` is 0, the string will not allocate.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::with_capacity(10);
@@ -71,7 +71,7 @@ pub fn with_capacity(capacity: uint) -> String {
 
     /// Creates a new string buffer from the given string.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let s = String::from_str("hello");
@@ -89,7 +89,7 @@ pub fn from_str(string: &str) -> String {
     /// Returns `Err` with the original vector if the vector contains invalid
     /// UTF-8.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let hello_vec = vec![104, 101, 108, 108, 111];
@@ -113,7 +113,7 @@ pub fn from_utf8(vec: Vec<u8>) -> Result<String, Vec<u8>> {
     /// Converts a vector of bytes to a new UTF-8 string.
     /// Any invalid UTF-8 sequences are replaced with U+FFFD REPLACEMENT CHARACTER.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let input = b"Hello \xF0\x90\x80World";
@@ -240,7 +240,7 @@ macro_rules! error(() => ({
     /// Decode a UTF-16 encoded vector `v` into a `String`, returning `None`
     /// if `v` contains any invalid data.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// // 𝄞music
@@ -267,7 +267,8 @@ pub fn from_utf16(v: &[u16]) -> Option<String> {
     /// Decode a UTF-16 encoded vector `v` into a string, replacing
     /// invalid data with the replacement character (U+FFFD).
     ///
-    /// # Example
+    /// # Examples
+    ///
     /// ```rust
     /// // 𝄞mus<invalid>ic<invalid>
     /// let v = &[0xD834, 0xDD1E, 0x006d, 0x0075,
@@ -284,7 +285,7 @@ pub fn from_utf16_lossy(v: &[u16]) -> String {
 
     /// Convert a vector of `char`s to a `String`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let chars = &['h', 'e', 'l', 'l', 'o'];
@@ -345,7 +346,7 @@ pub unsafe fn from_utf8_unchecked(bytes: Vec<u8>) -> String {
 
     /// Return the underlying byte buffer, encoded as UTF-8.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let s = String::from_str("hello");
@@ -360,7 +361,7 @@ pub fn into_bytes(self) -> Vec<u8> {
 
     /// Creates a string buffer by repeating a character `length` times.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let s = String::from_char(5, 'a');
@@ -386,7 +387,7 @@ pub fn from_char(length: uint, ch: char) -> String {
 
     /// Pushes the given string onto this string buffer.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::from_str("foo");
@@ -401,7 +402,7 @@ pub fn push_str(&mut self, string: &str) {
 
     /// Pushes `ch` onto the given string `count` times.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::from_str("foo");
@@ -418,7 +419,7 @@ pub fn grow(&mut self, count: uint, ch: char) {
 
     /// Returns the number of bytes that this string buffer can hold without reallocating.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let s = String::with_capacity(10);
@@ -443,7 +444,7 @@ pub fn reserve_additional(&mut self, extra: uint) {
     ///
     /// Panics if the new capacity overflows `uint`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::new();
@@ -467,7 +468,7 @@ pub fn reserve(&mut self, additional: uint) {
     ///
     /// Panics if the new capacity overflows `uint`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::new();
@@ -482,7 +483,7 @@ pub fn reserve_exact(&mut self, additional: uint) {
 
     /// Shrinks the capacity of this string buffer to match its length.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::from_str("foo");
@@ -499,7 +500,7 @@ pub fn shrink_to_fit(&mut self) {
 
     /// Adds the given character to the end of the string.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::from_str("abc");
@@ -529,7 +530,7 @@ pub fn push(&mut self, ch: char) {
 
     /// Works with the underlying buffer as a byte slice.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let s = String::from_str("hello");
@@ -549,7 +550,7 @@ pub fn as_bytes<'a>(&'a self) -> &'a [u8] {
     /// Panics if `new_len` > current length,
     /// or if `new_len` is not a character boundary.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::from_str("hello");
@@ -566,7 +567,7 @@ pub fn truncate(&mut self, new_len: uint) {
     /// Removes the last character from the string buffer and returns it.
     /// Returns `None` if this string buffer is empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::from_str("foo");
@@ -603,7 +604,7 @@ pub fn pop(&mut self) -> Option<char> {
     /// If `idx` does not lie on a character boundary, then this function will
     /// panic.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::from_str("foo");
@@ -664,7 +665,7 @@ pub fn insert(&mut self, idx: uint, ch: char) {
     /// This is unsafe because it does not check
     /// to ensure that the resulting string will be valid UTF-8.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = String::from_str("hello");
@@ -682,7 +683,7 @@ pub unsafe fn as_mut_vec<'a>(&'a mut self) -> &'a mut Vec<u8> {
 
     /// Return the number of bytes in this string.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let a = "foo".to_string();
@@ -694,7 +695,7 @@ pub fn len(&self) -> uint { self.vec.len() }
 
     /// Returns true if the string contains no bytes
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut v = String::new();
@@ -706,7 +707,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
 
     /// Truncates the string, returning it to 0 length.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut s = "foo".to_string();
index 3818be5a19791e6e1fe53f56399556536bb477ac..24395ca64939cfa180651c5d30fb1877ecfe97e7 100644 (file)
@@ -31,7 +31,7 @@
 /// as a right child. The time complexity is the same, and re-balancing
 /// operations are more frequent but also cheaper.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```
 /// use std::collections::TreeMap;
@@ -207,7 +207,7 @@ fn index_mut<'a>(&'a mut self, i: &Q) -> &'a mut V {
 impl<K: Ord, V> TreeMap<K, V> {
     /// Creates an empty `TreeMap`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -218,7 +218,7 @@ pub fn new() -> TreeMap<K, V> { TreeMap{root: None, length: 0} }
 
     /// Gets a lazy iterator over the keys in the map, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -240,7 +240,7 @@ pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
     /// Gets a lazy iterator over the values in the map, in ascending order
     /// with respect to the corresponding keys.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -261,7 +261,7 @@ pub fn values<'a>(&'a self) -> Values<'a, K, V> {
 
     /// Gets a lazy iterator over the key-value pairs in the map, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -287,7 +287,7 @@ pub fn iter<'a>(&'a self) -> Entries<'a, K, V> {
 
     /// Gets a lazy reverse iterator over the key-value pairs in the map, in descending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -308,7 +308,7 @@ pub fn rev_iter<'a>(&'a self) -> RevEntries<'a, K, V> {
     /// Gets a lazy forward iterator over the key-value pairs in the
     /// map, with the values being mutable.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -340,7 +340,7 @@ pub fn iter_mut<'a>(&'a mut self) -> MutEntries<'a, K, V> {
     /// Gets a lazy reverse iterator over the key-value pairs in the
     /// map, with the values being mutable.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -365,7 +365,7 @@ pub fn rev_iter_mut<'a>(&'a mut self) -> RevMutEntries<'a, K, V> {
 
     /// Gets a lazy iterator that consumes the treemap.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -393,7 +393,7 @@ pub fn into_iter(self) -> MoveEntries<K, V> {
 
     /// Return the number of elements in the map.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -408,7 +408,7 @@ pub fn len(&self) -> uint { self.length }
 
     /// Return true if the map contains no elements.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -424,7 +424,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
 
     /// Clears the map, removing all values.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -451,7 +451,7 @@ pub fn find(&self, key: &K) -> Option<&V> {
     /// 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.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -474,7 +474,7 @@ pub fn get<Sized? Q>(&self, key: &Q) -> Option<&V>
     /// 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.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -503,7 +503,7 @@ pub fn find_mut(&mut self, key: &K) -> Option<&mut V> {
     /// 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.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -533,7 +533,7 @@ pub fn swap(&mut self, key: K, value: V) -> Option<V> {
     /// Inserts a key-value pair from the map. If the key already had a value
     /// present in the map, that value is returned. Otherwise, `None` is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -565,7 +565,7 @@ pub fn pop(&mut self, key: &K) -> Option<V> {
     /// 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.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -590,7 +590,7 @@ impl<K, V> TreeMap<K, V> {
     /// with current key and guides tree navigation. That means `f` should
     /// be aware of natural ordering of the tree.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use collections::tree_map::TreeMap;
@@ -620,7 +620,7 @@ pub fn find_with(&self, f:|&K| -> Ordering) -> Option<&V> {
     /// with current key and guides tree navigation. That means `f` should
     /// be aware of natural ordering of the tree.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut t = collections::tree_map::TreeMap::new();
@@ -691,7 +691,7 @@ fn iter_for_traversal<'a>(&'a self) -> Entries<'a, K, V> {
     /// Returns a lazy iterator to the first key-value pair whose key is not less than `k`
     /// If all keys in map are less than `k` an empty iterator is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -713,7 +713,7 @@ pub fn lower_bound<'a>(&'a self, k: &K) -> Entries<'a, K, V> {
     /// Returns a lazy iterator to the first key-value pair whose key is greater than `k`
     /// If all keys in map are less than or equal to `k` an empty iterator is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -749,7 +749,7 @@ fn iter_mut_for_traversal<'a>(&'a mut self) -> MutEntries<'a, K, V> {
     /// If all keys in map are less than `k` an empty iterator is
     /// returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
@@ -783,7 +783,7 @@ pub fn lower_bound_mut<'a>(&'a mut self, k: &K) -> MutEntries<'a, K, V> {
     /// If all keys in map are less than or equal to `k` an empty iterator
     /// is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeMap;
index 15bf4988619cc24a6bbd806ae7b7bdec924cdeae..ea9aff564483fd94a3fc6932b2a766471b91d17b 100644 (file)
@@ -27,7 +27,7 @@
 /// only requirement is that the type of the elements contained ascribes to the
 /// `Ord` trait.
 ///
-/// ## Example
+/// ## Examples
 ///
 /// ```{rust}
 /// use std::collections::TreeSet;
@@ -142,7 +142,7 @@ fn default() -> TreeSet<T> { TreeSet::new() }
 impl<T: Ord> TreeSet<T> {
     /// Creates an empty `TreeSet`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -154,7 +154,7 @@ pub fn new() -> TreeSet<T> { TreeSet{map: TreeMap::new()} }
 
     /// Gets a lazy iterator over the values in the set, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -173,7 +173,7 @@ pub fn iter<'a>(&'a self) -> SetItems<'a, T> {
 
     /// Gets a lazy iterator over the values in the set, in descending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -192,7 +192,7 @@ pub fn rev_iter<'a>(&'a self) -> RevSetItems<'a, T> {
     /// Creates a consuming iterator, that is, one that moves each value out of the
     /// set in ascending order. The set cannot be used after calling this.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -211,7 +211,7 @@ pub fn into_iter(self) -> MoveSetItems<T> {
     /// Gets a lazy iterator pointing to the first value not less than `v` (greater or equal).
     /// If all elements in the set are less than `v` empty iterator is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -230,7 +230,7 @@ pub fn lower_bound<'a>(&'a self, v: &T) -> SetItems<'a, T> {
     /// If all elements in the set are less than or equal to `v` an
     /// empty iterator is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -247,7 +247,7 @@ pub fn upper_bound<'a>(&'a self, v: &T) -> SetItems<'a, T> {
 
     /// Visits the values representing the difference, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -275,7 +275,7 @@ pub fn difference<'a>(&'a self, other: &'a TreeSet<T>) -> DifferenceItems<'a, T>
 
     /// Visits the values representing the symmetric difference, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -302,7 +302,7 @@ pub fn symmetric_difference<'a>(&'a self, other: &'a TreeSet<T>)
 
     /// Visits the values representing the intersection, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -326,7 +326,7 @@ pub fn intersection<'a>(&'a self, other: &'a TreeSet<T>)
 
     /// Visits the values representing the union, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -349,7 +349,7 @@ pub fn union<'a>(&'a self, other: &'a TreeSet<T>) -> UnionItems<'a, T> {
 
     /// Return the number of elements in the set
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -365,7 +365,7 @@ pub fn len(&self) -> uint { self.map.len() }
 
     /// Returns true if the set contains no elements
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -380,7 +380,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
 
     /// Clears the set, removing all values.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -400,7 +400,7 @@ pub fn clear(&mut self) { self.map.clear() }
     /// but the ordering on the borrowed form *must* match the
     /// ordering on the value type.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -420,7 +420,7 @@ pub fn contains<Sized? Q>(&self, value: &Q) -> bool
     /// Returns `true` if the set has no elements in common with `other`.
     /// This is equivalent to checking for an empty intersection.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -441,7 +441,7 @@ pub fn is_disjoint(&self, other: &TreeSet<T>) -> bool {
 
     /// Returns `true` if the set is a subset of another.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -482,7 +482,7 @@ pub fn is_subset(&self, other: &TreeSet<T>) -> bool {
 
     /// Returns `true` if the set is a superset of another.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -507,7 +507,7 @@ pub fn is_superset(&self, other: &TreeSet<T>) -> bool {
     /// Adds a value to the set. Returns `true` if the value was not already
     /// present in the set.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -529,7 +529,7 @@ pub fn insert(&mut self, value: T) -> bool { self.map.insert(value, ()).is_none(
     /// but the ordering on the borrowed form *must* match the
     /// ordering on the value type.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -669,7 +669,7 @@ fn next(&mut self) -> Option<&'a T> {
 impl<T: Ord + Clone> BitOr<TreeSet<T>, TreeSet<T>> for TreeSet<T> {
     /// Returns the union of `self` and `rhs` as a new `TreeSet<T>`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -690,7 +690,7 @@ fn bitor(&self, rhs: &TreeSet<T>) -> TreeSet<T> {
 impl<T: Ord + Clone> BitAnd<TreeSet<T>, TreeSet<T>> for TreeSet<T> {
     /// Returns the intersection of `self` and `rhs` as a new `TreeSet<T>`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -711,7 +711,7 @@ fn bitand(&self, rhs: &TreeSet<T>) -> TreeSet<T> {
 impl<T: Ord + Clone> BitXor<TreeSet<T>, TreeSet<T>> for TreeSet<T> {
     /// Returns the symmetric difference of `self` and `rhs` as a new `TreeSet<T>`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
@@ -732,7 +732,7 @@ fn bitxor(&self, rhs: &TreeSet<T>) -> TreeSet<T> {
 impl<T: Ord + Clone> Sub<TreeSet<T>, TreeSet<T>> for TreeSet<T> {
     /// Returns the difference of `self` and `rhs` as a new `TreeSet<T>`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TreeSet;
index 6491c9a569dc621486a11819e4efc70159cbee1e..1b087d2e63dd5dfcd175e8e9115f3d57fec81e89 100644 (file)
@@ -53,7 +53,7 @@
 /// 4 bits. If both numbers are used as keys, a chain of maximum length will be created to
 /// differentiate them.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```
 /// use std::collections::TrieMap;
@@ -158,7 +158,7 @@ fn default() -> TrieMap<T> { TrieMap::new() }
 impl<T> TrieMap<T> {
     /// Creates an empty `TrieMap`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -173,7 +173,7 @@ pub fn new() -> TrieMap<T> {
     /// Visits all key-value pairs in reverse order. Aborts traversal when `f` returns `false`.
     /// Returns `true` if `f` returns `true` for all elements.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -209,7 +209,7 @@ pub fn values<'r>(&'r self) -> Values<'r, T> {
 
     /// Gets an iterator over the key-value pairs in the map, ordered by keys.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -233,7 +233,7 @@ pub fn iter<'a>(&'a self) -> Entries<'a, T> {
     /// Gets an iterator over the key-value pairs in the map, with the
     /// ability to mutate the values.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -260,7 +260,7 @@ pub fn iter_mut<'a>(&'a mut self) -> MutEntries<'a, T> {
 
     /// Return the number of elements in the map.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -276,7 +276,7 @@ pub fn len(&self) -> uint { self.length }
 
     /// Return true if the map contains no elements.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -292,7 +292,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
 
     /// Clears the map, removing all values.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -317,7 +317,7 @@ pub fn find(&self, key: &uint) -> Option<&T> {
 
     /// Returns a reference to the value corresponding to the key.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -350,7 +350,7 @@ pub fn get(&self, key: &uint) -> Option<&T> {
 
     /// Returns true if the map contains a value for the specified key.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -374,7 +374,7 @@ pub fn find_mut(&mut self, key: &uint) -> Option<&mut T> {
 
     /// Returns a mutable reference to the value corresponding to the key.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -402,7 +402,7 @@ pub fn swap(&mut self, key: uint, value: T) -> Option<T> {
     /// Inserts a key-value pair from the map. If the key already had a value
     /// present in the map, that value is returned. Otherwise, `None` is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -433,7 +433,7 @@ pub fn pop(&mut self, key: &uint) -> Option<T> {
     /// Removes a key from the map, returning the value at the key if the key
     /// was previously in the map.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -551,7 +551,7 @@ fn bound<'a>(&'a self, key: uint, upper: bool) -> Entries<'a, T> {
     /// Gets an iterator pointing to the first key-value pair whose key is not less than `key`.
     /// If all keys in the map are less than `key` an empty iterator is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -568,7 +568,7 @@ pub fn lower_bound<'a>(&'a self, key: uint) -> Entries<'a, T> {
     /// Gets an iterator pointing to the first key-value pair whose key is greater than `key`.
     /// If all keys in the map are not greater than `key` an empty iterator is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -593,7 +593,7 @@ fn bound_mut<'a>(&'a mut self, key: uint, upper: bool) -> MutEntries<'a, T> {
     /// Gets an iterator pointing to the first key-value pair whose key is not less than `key`.
     /// If all keys in the map are less than `key` an empty iterator is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
@@ -618,7 +618,7 @@ pub fn lower_bound_mut<'a>(&'a mut self, key: uint) -> MutEntries<'a, T> {
     /// Gets an iterator pointing to the first key-value pair whose key is greater than `key`.
     /// If all keys in the map are not greater than `key` an empty iterator is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieMap;
index 436da51174284d9aedbe40a87beae96de79c0bfb..46052ff2f5080c2e488317c097a703dfc782a86b 100644 (file)
@@ -24,7 +24,7 @@
 
 /// A set implemented as a radix trie.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```
 /// use std::collections::TrieSet;
@@ -77,7 +77,7 @@ fn default() -> TrieSet { TrieSet::new() }
 impl TrieSet {
     /// Creates an empty TrieSet.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -92,7 +92,7 @@ pub fn new() -> TrieSet {
     /// Visits all values in reverse order. Aborts traversal when `f` returns `false`.
     /// Returns `true` if `f` returns `true` for all elements.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -115,7 +115,7 @@ pub fn each_reverse(&self, f: |&uint| -> bool) -> bool {
 
     /// Gets an iterator over the values in the set, in sorted order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -140,7 +140,7 @@ pub fn iter<'a>(&'a self) -> SetItems<'a> {
     /// Gets an iterator pointing to the first value that is not less than `val`.
     /// If all values in the set are less than `val` an empty iterator is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -157,7 +157,7 @@ pub fn lower_bound<'a>(&'a self, val: uint) -> SetItems<'a> {
     /// Gets an iterator pointing to the first value that key is greater than `val`.
     /// If all values in the set are less than or equal to `val` an empty iterator is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -173,7 +173,7 @@ pub fn upper_bound<'a>(&'a self, val: uint) -> SetItems<'a> {
 
     /// Visits the values representing the difference, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -201,7 +201,7 @@ pub fn difference<'a>(&'a self, other: &'a TrieSet) -> DifferenceItems<'a> {
 
     /// Visits the values representing the symmetric difference, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -227,7 +227,7 @@ pub fn symmetric_difference<'a>(&'a self, other: &'a TrieSet) -> SymDifferenceIt
 
     /// Visits the values representing the intersection, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -250,7 +250,7 @@ pub fn intersection<'a>(&'a self, other: &'a TrieSet) -> IntersectionItems<'a> {
 
     /// Visits the values representing the union, in ascending order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -273,7 +273,7 @@ pub fn union<'a>(&'a self, other: &'a TrieSet) -> UnionItems<'a> {
 
     /// Return the number of elements in the set
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -289,7 +289,7 @@ pub fn len(&self) -> uint { self.map.len() }
 
     /// Returns true if the set contains no elements
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -304,7 +304,7 @@ pub fn is_empty(&self) -> bool { self.len() == 0 }
 
     /// Clears the set, removing all values.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -320,7 +320,7 @@ pub fn clear(&mut self) { self.map.clear() }
 
     /// Returns `true` if the set contains a value.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -338,7 +338,7 @@ pub fn contains(&self, value: &uint) -> bool {
     /// Returns `true` if the set has no elements in common with `other`.
     /// This is equivalent to checking for an empty intersection.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -360,7 +360,7 @@ pub fn is_disjoint(&self, other: &TrieSet) -> bool {
 
     /// Returns `true` if the set is a subset of another.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -382,7 +382,7 @@ pub fn is_subset(&self, other: &TrieSet) -> bool {
 
     /// Returns `true` if the set is a superset of another.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -408,7 +408,7 @@ pub fn is_superset(&self, other: &TrieSet) -> bool {
     /// Adds a value to the set. Returns `true` if the value was not already
     /// present in the set.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -428,7 +428,7 @@ pub fn insert(&mut self, value: uint) -> bool {
     /// Removes a value from the set. Returns `true` if the value was
     /// present in the set.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -466,7 +466,7 @@ fn extend<Iter: Iterator<uint>>(&mut self, mut iter: Iter) {
 impl BitOr<TrieSet, TrieSet> for TrieSet {
     /// Returns the union of `self` and `rhs` as a new `TrieSet`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -487,7 +487,7 @@ fn bitor(&self, rhs: &TrieSet) -> TrieSet {
 impl BitAnd<TrieSet, TrieSet> for TrieSet {
     /// Returns the intersection of `self` and `rhs` as a new `TrieSet`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -508,7 +508,7 @@ fn bitand(&self, rhs: &TrieSet) -> TrieSet {
 impl BitXor<TrieSet, TrieSet> for TrieSet {
     /// Returns the symmetric difference of `self` and `rhs` as a new `TrieSet`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
@@ -529,7 +529,7 @@ fn bitxor(&self, rhs: &TrieSet) -> TrieSet {
 impl Sub<TrieSet, TrieSet> for TrieSet {
     /// Returns the difference of `self` and `rhs` as a new `TrieSet`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::TrieSet;
index 1509306bbf5c3af7cdb115e6fa00cef3a6da1547..a575d1f4bd294dd8202ee7f56376a41d9a34a94a 100644 (file)
@@ -134,7 +134,7 @@ impl<T> Vec<T> {
     ///
     /// The vector will not allocate until elements are pushed onto it.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec: Vec<int> = Vec::new();
@@ -160,7 +160,7 @@ pub fn new() -> Vec<T> {
     /// the main `Vec` docs above, 'Capacity and reallocation'.) To create
     /// a vector of a given length, use `Vec::from_elem` or `Vec::from_fn`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec: Vec<int> = Vec::with_capacity(10);
@@ -197,7 +197,7 @@ pub fn with_capacity(capacity: uint) -> Vec<T> {
     /// Creates a `Vec` of size `length` and initializes the elements to the
     /// value returned by the closure `op`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let vec = Vec::from_fn(3, |idx| idx * 2);
@@ -222,7 +222,7 @@ pub fn from_fn(length: uint, op: |uint| -> T) -> Vec<T> {
     ///
     /// This is highly unsafe, due to the number of invariants that aren't checked.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::ptr;
@@ -279,7 +279,7 @@ pub unsafe fn from_raw_buf(ptr: *const T, elts: uint) -> Vec<T> {
     /// satisfy `f` and all elements of `B` do not. The order of elements is
     /// preserved.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let vec = vec![1i, 2i, 3i, 4i];
@@ -310,7 +310,8 @@ impl<T: Clone> Vec<T> {
     ///
     /// Creates a `Vec` with `length` copies of `value`.
     ///
-    /// # Example
+    /// # Examples
+    ///
     /// ```
     /// let vec = Vec::from_elem(3, "hi");
     /// println!("{}", vec); // prints [hi, hi, hi]
@@ -335,7 +336,7 @@ pub fn from_elem(length: uint, value: T) -> Vec<T> {
     /// Iterates over the slice `other`, clones each element, and then appends
     /// it to this `Vec`. The `other` vector is traversed in-order.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec = vec![1i];
@@ -366,7 +367,7 @@ pub fn push_all(&mut self, other: &[T]) {
     ///
     /// Adds `n` copies of `value` to the `Vec`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec = vec!["hello"];
@@ -390,7 +391,7 @@ pub fn grow(&mut self, n: uint, value: T) {
     /// `(a, b)`, where all elements of `a` satisfy `f` and all elements of `b`
     /// do not. The order of elements is preserved.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let vec = vec![1i, 2, 3, 4];
@@ -641,7 +642,7 @@ impl<T> Vec<T> {
     /// Returns the number of elements the vector can hold without
     /// reallocating.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let vec: Vec<int> = Vec::with_capacity(10);
@@ -666,7 +667,7 @@ pub fn reserve_additional(&mut self, extra: uint) {
     ///
     /// Panics if the new capacity overflows `uint`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec: Vec<int> = vec![1];
@@ -704,7 +705,7 @@ pub fn reserve(&mut self, additional: uint) {
     ///
     /// Panics if the new capacity overflows `uint`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec: Vec<int> = vec![1];
@@ -725,7 +726,7 @@ pub fn reserve_exact(&mut self, additional: uint) {
     /// down as close as possible to the length but the allocator may still
     /// inform the vector that there is space for a few more elements.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec: Vec<int> = Vec::with_capacity(10);
@@ -778,7 +779,7 @@ pub fn into_boxed_slice(mut self) -> Box<[T]> {
     /// If `len` is greater than the vector's current length, this has no
     /// effect.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec = vec![1i, 2, 3, 4];
@@ -800,7 +801,7 @@ pub fn truncate(&mut self, len: uint) {
 
     /// Returns a mutable slice of the elements of `self`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// fn foo(slice: &mut [int]) {}
@@ -823,7 +824,7 @@ pub fn as_mut_slice<'a>(&'a mut self) -> &'a mut [T] {
     /// value out of the vector (from start to end). The vector cannot
     /// be used after calling this.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let v = vec!["a".to_string(), "b".to_string()];
@@ -855,7 +856,7 @@ pub fn into_iter(self) -> MoveItems<T> {
     /// modifying its buffers, so it is up to the caller to ensure that the
     /// vector is actually the specified size.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut v = vec![1u, 2, 3, 4];
@@ -874,7 +875,8 @@ pub unsafe fn set_len(&mut self, len: uint) {
     ///
     /// Returns `None` if `index` is out of bounds.
     ///
-    /// # Example
+    /// # Examples
+    ///
     /// ```
     /// let mut v = vec!["foo", "bar", "baz", "qux"];
     ///
@@ -906,7 +908,7 @@ pub fn swap_remove(&mut self, index: uint) -> Option<T> {
     /// Panics if `index` is not between `0` and the vector's length (both
     /// bounds inclusive).
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec = vec![1i, 2, 3];
@@ -941,7 +943,7 @@ pub fn insert(&mut self, index: uint, element: T) {
     /// shifting all elements after position `index` one position to the left.
     /// Returns `None` if `i` is out of bounds.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut v = vec![1i, 2, 3];
@@ -981,7 +983,7 @@ pub fn remove(&mut self, index: uint) -> Option<T> {
     /// In other words, remove all elements `e` such that `f(&e)` returns false.
     /// This method operates in place and preserves the order of the retained elements.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec = vec![1i, 2, 3, 4];
@@ -1013,7 +1015,7 @@ pub fn retain(&mut self, f: |&T| -> bool) {
     /// The vector is grown by `n` elements. The i-th new element are initialized to the value
     /// returned by `f(i)` where `i` is in the range [0, n).
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec = vec![0u, 1];
@@ -1034,7 +1036,7 @@ pub fn grow_fn(&mut self, n: uint, f: |uint| -> T) {
     ///
     /// Panics if the number of elements in the vector overflows a `uint`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let mut vec = vec!(1i, 2);
@@ -1071,7 +1073,7 @@ pub fn push(&mut self, value: T) {
     /// Removes the last element from a vector and returns it, or `None` if
     /// it is empty.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```rust
     /// let mut vec = vec![1i, 2, 3];
@@ -1093,7 +1095,7 @@ pub fn pop(&mut self) -> Option<T> {
 
     /// Clears the vector, removing all values.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut v = vec![1i, 2, 3];
@@ -1108,7 +1110,7 @@ pub fn clear(&mut self) {
 
     /// Return the number of elements in the vector
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let a = vec![1i, 2, 3];
@@ -1120,7 +1122,7 @@ pub fn len(&self) -> uint { self.len }
 
     /// Returns true if the vector contains no elements
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut v = Vec::new();
@@ -1155,7 +1157,7 @@ impl<T: PartialEq> Vec<T> {
     ///
     /// If the vector is sorted, this removes all duplicates.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let mut vec = vec![1i, 2, 2, 3, 2];
@@ -1251,7 +1253,7 @@ pub fn dedup(&mut self) {
 impl<T> AsSlice<T> for Vec<T> {
     /// Returns a slice into `self`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// fn foo(slice: &[int]) {}
@@ -1555,7 +1557,7 @@ impl<T> Vec<T> {
     /// Panics if `T` and `U` have differing sizes or are not zero-sized and
     /// have differing minimal alignments.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// let v = vec![0u, 1, 2];
index 97b80108d766ef6c60dd72d88dee162f99d9442b..968be982be4da9f322c5948dbbfbeaa762eeb7ec 100644 (file)
@@ -30,7 +30,7 @@
 
 /// A map optimized for small integer keys.
 ///
-/// # Example
+/// # Examples
 ///
 /// ```
 /// use std::collections::VecMap;
@@ -92,7 +92,7 @@ fn hash(&self, state: &mut S) {
 impl<V> VecMap<V> {
     /// Creates an empty `VecMap`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -104,7 +104,7 @@ pub fn new() -> VecMap<V> { VecMap{v: vec!()} }
     /// Creates an empty `VecMap` with space for at least `capacity`
     /// elements before resizing.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -118,7 +118,7 @@ pub fn with_capacity(capacity: uint) -> VecMap<V> {
     /// Returns the number of elements the `VecMap` can hold without
     /// reallocating.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -148,7 +148,7 @@ pub fn values<'r>(&'r self) -> Values<'r, V> {
     /// Returns an iterator visiting all key-value pairs in ascending order by the keys.
     /// The iterator's element type is `(uint, &'r V)`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -176,7 +176,7 @@ pub fn iter<'r>(&'r self) -> Entries<'r, V> {
     /// with mutable references to the values.
     /// The iterator's element type is `(uint, &'r mut V)`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -207,7 +207,7 @@ pub fn iter_mut<'r>(&'r mut self) -> MutEntries<'r, V> {
     /// the keys, emptying (but not consuming) the original `VecMap`.
     /// The iterator's element type is `(uint, &'r V)`.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -235,7 +235,7 @@ pub fn into_iter(&mut self)
 
     /// Return the number of elements in the map.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -252,7 +252,7 @@ pub fn len(&self) -> uint {
 
     /// Return true if the map contains no elements.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -269,7 +269,7 @@ pub fn is_empty(&self) -> bool {
 
     /// Clears the map, removing all key-value pairs.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -290,7 +290,7 @@ pub fn find(&self, key: &uint) -> Option<&V> {
 
     /// Returns a reference to the value corresponding to the key.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -314,7 +314,7 @@ pub fn get(&self, key: &uint) -> Option<&V> {
 
     /// Returns true if the map contains a value for the specified key.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -338,7 +338,7 @@ pub fn find_mut(&mut self, key: &uint) -> Option<&mut V> {
 
     /// Returns a mutable reference to the value corresponding to the key.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -372,7 +372,7 @@ pub fn swap(&mut self, key: uint, value: V) -> Option<V> {
     /// Inserts a key-value pair from the map. If the key already had a value
     /// present in the map, that value is returned. Otherwise, `None` is returned.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -403,7 +403,7 @@ pub fn pop(&mut self, key: &uint) -> Option<V> {
     /// Removes a key from the map, returning the value at the key if the key
     /// was previously in the map.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -428,7 +428,7 @@ impl<V:Clone> VecMap<V> {
     /// Otherwise, sets the value to `newval`.
     /// Returns `true` if the key did not already exist in the map.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;
@@ -452,7 +452,7 @@ pub fn update(&mut self, key: uint, newval: V, ff: |V, V| -> V) -> bool {
     /// Otherwise, sets the value to `newval`.
     /// Returns `true` if the key did not already exist in the map.
     ///
-    /// # Example
+    /// # Examples
     ///
     /// ```
     /// use std::collections::VecMap;