diff --git a/src/libcollections/binary_heap.rs b/src/libcollections/binary_heap.rs index e321ef16f66b5..347300e25aded 100644 --- a/src/libcollections/binary_heap.rs +++ b/src/libcollections/binary_heap.rs @@ -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 @@ impl Default for BinaryHeap { impl BinaryHeap { /// Creates an empty `BinaryHeap` as a max-heap. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; @@ -192,7 +192,7 @@ impl BinaryHeap { /// 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 @@ impl BinaryHeap { /// Creates a `BinaryHeap` from a vector. This is sometimes called /// `heapifying` the vector. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; @@ -225,7 +225,7 @@ impl BinaryHeap { /// An iterator visiting all values in underlying vector, in /// arbitrary order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; @@ -245,7 +245,7 @@ impl BinaryHeap { /// 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 @@ impl BinaryHeap { /// Returns the greatest item in a queue, or `None` if it is empty. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; @@ -284,7 +284,7 @@ impl BinaryHeap { /// Returns the number of elements the queue can hold without reallocating. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; @@ -306,7 +306,7 @@ impl BinaryHeap { /// /// Panics if the new capacity overflows `uint`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; @@ -325,7 +325,7 @@ impl BinaryHeap { /// /// Panics if the new capacity overflows `uint`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; @@ -348,7 +348,7 @@ impl BinaryHeap { /// 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 @@ impl BinaryHeap { /// Pushes an item onto the queue. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; @@ -398,7 +398,7 @@ impl BinaryHeap { /// 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 @@ impl BinaryHeap { /// an optimized fashion. The push is done regardless of whether the queue /// was empty. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; @@ -450,7 +450,7 @@ impl BinaryHeap { /// Consumes the `BinaryHeap` and returns the underlying vector /// in arbitrary order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; @@ -468,7 +468,7 @@ impl BinaryHeap { /// Consumes the `BinaryHeap` and returns a vector in sorted /// (ascending) order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BinaryHeap; diff --git a/src/libcollections/bit.rs b/src/libcollections/bit.rs index ad5732c47a891..b401978c9c9cd 100644 --- a/src/libcollections/bit.rs +++ b/src/libcollections/bit.rs @@ -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 @@ static FALSE: bool = false; /// The bitvector type. /// -/// # Example +/// # Examples /// /// ```rust /// use collections::Bitv; @@ -214,7 +214,7 @@ impl Bitv { /// Creates an empty `Bitv`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::Bitv; @@ -228,7 +228,7 @@ impl Bitv { /// Creates a `Bitv` that holds `nbits` elements, setting each element /// to `init`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::Bitv; @@ -262,7 +262,7 @@ impl Bitv { /// /// Panics if `i` is out of bounds. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -289,7 +289,7 @@ impl Bitv { /// /// Panics if `i` is out of bounds. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::Bitv; @@ -311,7 +311,7 @@ impl Bitv { /// Sets all bits to 1. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -330,7 +330,7 @@ impl Bitv { /// Flips all bits. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -357,7 +357,7 @@ impl Bitv { /// /// Panics if the bitvectors are of different lengths. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -387,7 +387,7 @@ impl Bitv { /// /// Panics if the bitvectors are of different lengths. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -417,7 +417,7 @@ impl Bitv { /// /// Panics if the bitvectors are of different length. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -446,7 +446,7 @@ impl Bitv { /// Returns `true` if all bits are 1. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::Bitv; @@ -469,7 +469,7 @@ impl Bitv { /// Returns an iterator over the elements of the vector in order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -484,7 +484,7 @@ impl Bitv { /// Returns `true` if all bits are 0. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::Bitv; @@ -501,7 +501,7 @@ impl Bitv { /// Returns `true` if any bit is 1. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::Bitv; @@ -522,7 +522,7 @@ impl Bitv { /// 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 @@ impl Bitv { /// Transforms `self` into a `Vec` by turning each bit into a `bool`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -584,7 +584,7 @@ impl Bitv { /// /// Panics if the `Bitv` and slice are of different length. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -609,7 +609,7 @@ impl Bitv { /// If `len` is greater than the vector's current length, this has no /// effect. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -633,7 +633,7 @@ impl Bitv { /// Grows the vector to be able to store `size` bits without resizing. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::Bitv; @@ -654,7 +654,7 @@ impl Bitv { /// 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 @@ impl Bitv { /// Grows the `Bitv` in-place, adding `n` copies of `value` to the `Bitv`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -722,7 +722,7 @@ impl Bitv { /// /// Assert if empty. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::bitv; @@ -745,7 +745,7 @@ impl Bitv { /// Pushes a `bool` onto the end. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::Bitv; @@ -786,7 +786,7 @@ impl Bitv { /// 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 @@ impl<'a> RandomAccessIterator for Bits<'a> { /// 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 @@ impl 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 @@ impl BitvSet { /// Creates a new bit vector set from the given bit vector. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::{bitv, BitvSet}; @@ -1107,7 +1107,7 @@ impl 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 @@ impl BitvSet { /// Grows the underlying vector to be able to store `size` bits. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BitvSet; @@ -1143,7 +1143,7 @@ impl BitvSet { /// Consumes this set to return the underlying bit vector. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BitvSet; @@ -1164,7 +1164,7 @@ impl BitvSet { /// Returns a reference to the underlying bit vector. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BitvSet; @@ -1206,7 +1206,7 @@ impl BitvSet { /// Truncates the underlying vector to the least length required. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BitvSet; @@ -1238,7 +1238,7 @@ impl BitvSet { /// Iterator over each u32 stored in the `BitvSet`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BitvSet; @@ -1260,7 +1260,7 @@ impl BitvSet { /// 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 @@ impl BitvSet { /// 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 @@ impl BitvSet { /// 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 @@ impl BitvSet { /// See [symmetric_difference_with](#method.symmetric_difference_with) for /// an efficient in-place version. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BitvSet; @@ -1384,7 +1384,7 @@ impl BitvSet { /// Unions in-place with the specified other bit vector. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BitvSet; @@ -1408,7 +1408,7 @@ impl BitvSet { /// Intersects in-place with the specified other bit vector. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BitvSet; @@ -1433,7 +1433,7 @@ impl 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 @@ impl BitvSet { /// Makes this bit vector the symmetric difference with the specified other /// bit vector in-place. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BitvSet; diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index b3dc9139eb324..9d2b3f3bb7097 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -152,7 +152,7 @@ impl BTreeMap { /// Clears the map, removing all values. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeMap; @@ -188,7 +188,7 @@ impl BTreeMap { /// 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 @@ impl BTreeMap { /// 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 @@ impl BTreeMap { /// 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 @@ impl BTreeMap { /// 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 @@ impl BTreeMap { /// 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 @@ impl BTreeMap { /// Gets an iterator over the keys of the map. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeMap; @@ -1088,7 +1088,7 @@ impl BTreeMap { /// Gets an iterator over the values of the map. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeMap; @@ -1107,7 +1107,7 @@ impl BTreeMap { /// Return the number of elements in the map. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeMap; @@ -1122,7 +1122,7 @@ impl BTreeMap { /// Return true if the map contains no elements. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeMap; diff --git a/src/libcollections/btree/set.rs b/src/libcollections/btree/set.rs index 573b5a9422b84..2f9c383660441 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -95,7 +95,7 @@ impl BTreeSet { impl BTreeSet { /// Visits the values representing the difference, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeSet; @@ -118,7 +118,7 @@ impl BTreeSet { /// Visits the values representing the symmetric difference, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeSet; @@ -142,7 +142,7 @@ impl BTreeSet { /// Visits the values representing the intersection, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeSet; @@ -166,7 +166,7 @@ impl BTreeSet { /// Visits the values representing the union, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeSet; @@ -187,7 +187,7 @@ impl BTreeSet { /// Return the number of elements in the set /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeSet; @@ -202,7 +202,7 @@ impl BTreeSet { /// Returns true if the set contains no elements /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeSet; @@ -217,7 +217,7 @@ impl BTreeSet { /// Clears the set, removing all values. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeSet; @@ -238,7 +238,7 @@ impl BTreeSet { /// 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 @@ impl BTreeSet { /// 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 @@ impl BTreeSet { /// Returns `true` if the set is a subset of another. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeSet; @@ -318,7 +318,7 @@ impl BTreeSet { /// Returns `true` if the set is a superset of another. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeSet; @@ -343,7 +343,7 @@ impl BTreeSet { /// 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 @@ impl BTreeSet { /// but the ordering on the borrowed form *must* match the /// ordering on the value type. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::BTreeSet; diff --git a/src/libcollections/dlist.rs b/src/libcollections/dlist.rs index a30bb9e978b50..f8492f493d19b 100644 --- a/src/libcollections/dlist.rs +++ b/src/libcollections/dlist.rs @@ -204,7 +204,7 @@ impl DList { /// /// If the list is empty, does nothing. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::DList; @@ -231,7 +231,7 @@ impl DList { /// /// If the list is empty, does nothing. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::DList; @@ -258,7 +258,7 @@ impl DList { /// /// This operation should compute in O(1) time. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::DList; @@ -299,7 +299,7 @@ impl DList { /// /// This operation should compute in O(1) time. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::DList; @@ -328,7 +328,7 @@ impl DList { /// /// This operation should compute in O(N) time. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::DList; @@ -500,7 +500,7 @@ impl DList { /// Appends an element to the back of a list /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::DList; @@ -524,7 +524,7 @@ impl DList { /// Removes the last element from a list and returns it, or `None` if /// it is empty. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::DList; diff --git a/src/libcollections/hash/mod.rs b/src/libcollections/hash/mod.rs index 1dc2539c592e9..637541a8fd654 100644 --- a/src/libcollections/hash/mod.rs +++ b/src/libcollections/hash/mod.rs @@ -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; diff --git a/src/libcollections/ring_buf.rs b/src/libcollections/ring_buf.rs index d9e5dde96ceee..95207cbf205e0 100644 --- a/src/libcollections/ring_buf.rs +++ b/src/libcollections/ring_buf.rs @@ -137,7 +137,7 @@ impl RingBuf { /// Retrieves an element in the `RingBuf` by index. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::RingBuf; @@ -160,7 +160,7 @@ impl RingBuf { /// Retrieves an element in the `RingBuf` mutably by index. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::RingBuf; @@ -194,7 +194,7 @@ impl RingBuf { /// /// Fails if there is no element with either index. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::RingBuf; @@ -220,7 +220,7 @@ impl RingBuf { /// Returns the number of elements the `RingBuf` can hold without /// reallocating. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::RingBuf; @@ -243,7 +243,7 @@ impl RingBuf { /// /// Panics if the new capacity overflows `uint`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::RingBuf; @@ -264,7 +264,7 @@ impl RingBuf { /// /// Panics if the new capacity overflows `uint`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::RingBuf; @@ -342,7 +342,7 @@ impl RingBuf { /// Returns a front-to-back iterator. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::RingBuf; @@ -365,7 +365,7 @@ impl RingBuf { /// Returns a front-to-back iterator which returns mutable references. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::RingBuf; @@ -402,7 +402,7 @@ impl RingBuf { /// Returns the number of elements in the `RingBuf`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::RingBuf; @@ -417,7 +417,7 @@ impl RingBuf { /// Returns true if the buffer contains no elements /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::RingBuf; @@ -432,7 +432,7 @@ impl RingBuf { /// Clears the buffer, removing all values. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::RingBuf; @@ -452,7 +452,7 @@ impl RingBuf { /// Provides a reference to the front element, or `None` if the sequence is /// empty. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::RingBuf; @@ -472,7 +472,7 @@ impl RingBuf { /// 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 @@ impl RingBuf { /// Provides a reference to the back element, or `None` if the sequence is /// empty. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::RingBuf; @@ -516,7 +516,7 @@ impl RingBuf { /// 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 @@ impl RingBuf { /// Removes the first element and returns it, or `None` if the sequence is /// empty. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::RingBuf; @@ -567,7 +567,7 @@ impl RingBuf { /// Inserts an element first in the sequence. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::RingBuf; @@ -597,7 +597,7 @@ impl RingBuf { /// Appends an element to the back of a buffer /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::RingBuf; @@ -628,7 +628,7 @@ impl RingBuf { /// Removes the last element from a buffer and returns it, or `None` if /// it is empty. /// - /// # Example + /// # Examples /// /// ```rust /// use std::collections::RingBuf; diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 03b8ea8f20fa5..96d3ecb4d679d 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -297,7 +297,7 @@ pub trait CloneSliceAllocPrelude 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 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 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 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 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]; diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 28027198143f0..3195d76d98899 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -93,7 +93,7 @@ Section: Creating a string 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 @@ impl<'a> Iterator for Recompositions<'a> { /// /// The original string with all occurrences of `from` replaced with `to`. /// -/// # Example +/// # Examples /// /// ```rust /// use std::str; @@ -440,7 +440,7 @@ pub type SendStr = CowString<'static>; 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 @@ impl<'a> MaybeOwned<'a> { /// 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 @@ impl<'a> IntoMaybeOwned<'a> for String { #[deprecated = "use std::borrow::IntoCow"] #[allow(deprecated)] impl<'a> IntoMaybeOwned<'a> for &'a str { - /// # Example + /// # Examples /// /// ``` ignore /// let string = "orange"; @@ -524,7 +524,7 @@ impl<'a> IntoMaybeOwned<'a> for &'a str { #[allow(deprecated)] #[deprecated = "use std::borrow::IntoCow"] impl<'a> IntoMaybeOwned<'a> for MaybeOwned<'a> { - /// # Example + /// # Examples /// /// ``` ignore /// let str = "orange"; @@ -708,7 +708,7 @@ pub trait StrAllocating: Str { /// /// The original string with all occurrences of `from` replaced with `to`. /// - /// # Example + /// # Examples /// /// ```rust /// let s = "Do you know the muffin man, diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 571f3fa468589..bad7b069df22a 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -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 @@ impl 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 @@ impl String { /// Creates a new string buffer from the given string. /// - /// # Example + /// # Examples /// /// ``` /// let s = String::from_str("hello"); @@ -89,7 +89,7 @@ impl 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 @@ impl String { /// 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 @@ impl String { /// 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 @@ impl String { /// Decode a UTF-16 encoded vector `v` into a string, replacing /// invalid data with the replacement character (U+FFFD). /// - /// # Example + /// # Examples + /// /// ```rust /// // š¯„˛music /// let v = &[0xD834, 0xDD1E, 0x006d, 0x0075, @@ -284,7 +285,7 @@ impl String { /// Convert a vector of `char`s to a `String`. /// - /// # Example + /// # Examples /// /// ```rust /// let chars = &['h', 'e', 'l', 'l', 'o']; @@ -345,7 +346,7 @@ impl String { /// Return the underlying byte buffer, encoded as UTF-8. /// - /// # Example + /// # Examples /// /// ``` /// let s = String::from_str("hello"); @@ -360,7 +361,7 @@ impl String { /// Creates a string buffer by repeating a character `length` times. /// - /// # Example + /// # Examples /// /// ``` /// let s = String::from_char(5, 'a'); @@ -386,7 +387,7 @@ impl String { /// Pushes the given string onto this string buffer. /// - /// # Example + /// # Examples /// /// ``` /// let mut s = String::from_str("foo"); @@ -401,7 +402,7 @@ impl String { /// Pushes `ch` onto the given string `count` times. /// - /// # Example + /// # Examples /// /// ``` /// let mut s = String::from_str("foo"); @@ -418,7 +419,7 @@ impl String { /// 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 @@ impl String { /// /// Panics if the new capacity overflows `uint`. /// - /// # Example + /// # Examples /// /// ``` /// let mut s = String::new(); @@ -467,7 +468,7 @@ impl String { /// /// Panics if the new capacity overflows `uint`. /// - /// # Example + /// # Examples /// /// ``` /// let mut s = String::new(); @@ -482,7 +483,7 @@ impl String { /// Shrinks the capacity of this string buffer to match its length. /// - /// # Example + /// # Examples /// /// ``` /// let mut s = String::from_str("foo"); @@ -499,7 +500,7 @@ impl String { /// Adds the given character to the end of the string. /// - /// # Example + /// # Examples /// /// ``` /// let mut s = String::from_str("abc"); @@ -529,7 +530,7 @@ impl String { /// Works with the underlying buffer as a byte slice. /// - /// # Example + /// # Examples /// /// ``` /// let s = String::from_str("hello"); @@ -549,7 +550,7 @@ impl String { /// 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 @@ impl String { /// 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 @@ impl String { /// 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 @@ impl String { /// 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 @@ impl String { /// Return the number of bytes in this string. /// - /// # Example + /// # Examples /// /// ``` /// let a = "foo".to_string(); @@ -694,7 +695,7 @@ impl String { /// Returns true if the string contains no bytes /// - /// # Example + /// # Examples /// /// ``` /// let mut v = String::new(); @@ -706,7 +707,7 @@ impl String { /// Truncates the string, returning it to 0 length. /// - /// # Example + /// # Examples /// /// ``` /// let mut s = "foo".to_string(); diff --git a/src/libcollections/tree/map.rs b/src/libcollections/tree/map.rs index 3818be5a19791..24395ca64939c 100644 --- a/src/libcollections/tree/map.rs +++ b/src/libcollections/tree/map.rs @@ -31,7 +31,7 @@ use vec::Vec; /// 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 @@ impl IndexMut for TreeMap where Q: BorrowFrom TreeMap { /// Creates an empty `TreeMap`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeMap; @@ -218,7 +218,7 @@ impl TreeMap { /// Gets a lazy iterator over the keys in the map, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeMap; @@ -240,7 +240,7 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// Gets a lazy iterator that consumes the treemap. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeMap; @@ -393,7 +393,7 @@ impl TreeMap { /// Return the number of elements in the map. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeMap; @@ -408,7 +408,7 @@ impl TreeMap { /// Return true if the map contains no elements. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeMap; @@ -424,7 +424,7 @@ impl TreeMap { /// Clears the map, removing all values. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeMap; @@ -451,7 +451,7 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// 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 TreeMap { /// 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 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// 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 @@ impl TreeMap { /// If all keys in map are less than `k` an empty iterator is /// returned. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeMap; @@ -783,7 +783,7 @@ impl TreeMap { /// If all keys in map are less than or equal to `k` an empty iterator /// is returned. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeMap; diff --git a/src/libcollections/tree/set.rs b/src/libcollections/tree/set.rs index 15bf4988619cc..ea9aff564483f 100644 --- a/src/libcollections/tree/set.rs +++ b/src/libcollections/tree/set.rs @@ -27,7 +27,7 @@ use tree_map::{TreeMap, Entries, RevEntries, MoveEntries}; /// 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 @@ impl Default for TreeSet { impl TreeSet { /// Creates an empty `TreeSet`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -154,7 +154,7 @@ impl TreeSet { /// Gets a lazy iterator over the values in the set, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -173,7 +173,7 @@ impl TreeSet { /// Gets a lazy iterator over the values in the set, in descending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -192,7 +192,7 @@ impl TreeSet { /// 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 @@ impl TreeSet { /// 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 @@ impl TreeSet { /// 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 @@ impl TreeSet { /// Visits the values representing the difference, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -275,7 +275,7 @@ impl TreeSet { /// Visits the values representing the symmetric difference, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -302,7 +302,7 @@ impl TreeSet { /// Visits the values representing the intersection, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -326,7 +326,7 @@ impl TreeSet { /// Visits the values representing the union, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -349,7 +349,7 @@ impl TreeSet { /// Return the number of elements in the set /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -365,7 +365,7 @@ impl TreeSet { /// Returns true if the set contains no elements /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -380,7 +380,7 @@ impl TreeSet { /// Clears the set, removing all values. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -400,7 +400,7 @@ impl TreeSet { /// 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 @@ impl TreeSet { /// 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 @@ impl TreeSet { /// Returns `true` if the set is a subset of another. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -482,7 +482,7 @@ impl TreeSet { /// Returns `true` if the set is a superset of another. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -507,7 +507,7 @@ impl TreeSet { /// 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 @@ impl TreeSet { /// 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 @@ impl<'a, T: Ord> Iterator<&'a T> for UnionItems<'a, T> { impl BitOr, TreeSet> for TreeSet { /// Returns the union of `self` and `rhs` as a new `TreeSet`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -690,7 +690,7 @@ impl BitOr, TreeSet> for TreeSet { impl BitAnd, TreeSet> for TreeSet { /// Returns the intersection of `self` and `rhs` as a new `TreeSet`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -711,7 +711,7 @@ impl BitAnd, TreeSet> for TreeSet { impl BitXor, TreeSet> for TreeSet { /// Returns the symmetric difference of `self` and `rhs` as a new `TreeSet`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; @@ -732,7 +732,7 @@ impl BitXor, TreeSet> for TreeSet { impl Sub, TreeSet> for TreeSet { /// Returns the difference of `self` and `rhs` as a new `TreeSet`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TreeSet; diff --git a/src/libcollections/trie/map.rs b/src/libcollections/trie/map.rs index 6491c9a569dc6..1b087d2e63dd5 100644 --- a/src/libcollections/trie/map.rs +++ b/src/libcollections/trie/map.rs @@ -53,7 +53,7 @@ const MAX_DEPTH: uint = uint::BITS / SHIFT; /// 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 @@ impl Default for TrieMap { impl TrieMap { /// Creates an empty `TrieMap`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieMap; @@ -173,7 +173,7 @@ impl TrieMap { /// 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 @@ impl TrieMap { /// Gets an iterator over the key-value pairs in the map, ordered by keys. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieMap; @@ -233,7 +233,7 @@ impl TrieMap { /// 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 @@ impl TrieMap { /// Return the number of elements in the map. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieMap; @@ -276,7 +276,7 @@ impl TrieMap { /// Return true if the map contains no elements. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieMap; @@ -292,7 +292,7 @@ impl TrieMap { /// Clears the map, removing all values. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieMap; @@ -317,7 +317,7 @@ impl TrieMap { /// Returns a reference to the value corresponding to the key. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieMap; @@ -350,7 +350,7 @@ impl TrieMap { /// Returns true if the map contains a value for the specified key. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieMap; @@ -374,7 +374,7 @@ impl TrieMap { /// Returns a mutable reference to the value corresponding to the key. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieMap; @@ -402,7 +402,7 @@ impl TrieMap { /// 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 @@ impl TrieMap { /// 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 @@ impl TrieMap { /// 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 @@ impl TrieMap { /// 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 @@ impl TrieMap { /// 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 @@ impl TrieMap { /// 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; diff --git a/src/libcollections/trie/set.rs b/src/libcollections/trie/set.rs index 436da51174284..46052ff2f5080 100644 --- a/src/libcollections/trie/set.rs +++ b/src/libcollections/trie/set.rs @@ -24,7 +24,7 @@ use trie_map::{TrieMap, Entries}; /// A set implemented as a radix trie. /// -/// # Example +/// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -77,7 +77,7 @@ impl Default for TrieSet { impl TrieSet { /// Creates an empty TrieSet. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -92,7 +92,7 @@ impl 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 @@ impl TrieSet { /// Gets an iterator over the values in the set, in sorted order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -140,7 +140,7 @@ impl TrieSet { /// 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 @@ impl TrieSet { /// 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 @@ impl TrieSet { /// Visits the values representing the difference, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -201,7 +201,7 @@ impl TrieSet { /// Visits the values representing the symmetric difference, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -227,7 +227,7 @@ impl TrieSet { /// Visits the values representing the intersection, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -250,7 +250,7 @@ impl TrieSet { /// Visits the values representing the union, in ascending order. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -273,7 +273,7 @@ impl TrieSet { /// Return the number of elements in the set /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -289,7 +289,7 @@ impl TrieSet { /// Returns true if the set contains no elements /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -304,7 +304,7 @@ impl TrieSet { /// Clears the set, removing all values. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -320,7 +320,7 @@ impl TrieSet { /// Returns `true` if the set contains a value. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -338,7 +338,7 @@ impl TrieSet { /// 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 @@ impl TrieSet { /// Returns `true` if the set is a subset of another. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -382,7 +382,7 @@ impl TrieSet { /// Returns `true` if the set is a superset of another. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -408,7 +408,7 @@ impl TrieSet { /// 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 @@ impl TrieSet { /// 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 @@ impl Extend for TrieSet { impl BitOr for TrieSet { /// Returns the union of `self` and `rhs` as a new `TrieSet`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -487,7 +487,7 @@ impl BitOr for TrieSet { impl BitAnd for TrieSet { /// Returns the intersection of `self` and `rhs` as a new `TrieSet`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -508,7 +508,7 @@ impl BitAnd for TrieSet { impl BitXor for TrieSet { /// Returns the symmetric difference of `self` and `rhs` as a new `TrieSet`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; @@ -529,7 +529,7 @@ impl BitXor for TrieSet { impl Sub for TrieSet { /// Returns the difference of `self` and `rhs` as a new `TrieSet`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::TrieSet; diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 1509306bbf5c3..a575d1f4bd294 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -134,7 +134,7 @@ impl Vec { /// /// The vector will not allocate until elements are pushed onto it. /// - /// # Example + /// # Examples /// /// ``` /// let mut vec: Vec = Vec::new(); @@ -160,7 +160,7 @@ impl Vec { /// 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 = Vec::with_capacity(10); @@ -197,7 +197,7 @@ impl Vec { /// 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 @@ impl Vec { /// /// This is highly unsafe, due to the number of invariants that aren't checked. /// - /// # Example + /// # Examples /// /// ``` /// use std::ptr; @@ -279,7 +279,7 @@ impl Vec { /// 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 Vec { /// /// 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 @@ impl Vec { /// 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 @@ impl Vec { /// /// Adds `n` copies of `value` to the `Vec`. /// - /// # Example + /// # Examples /// /// ``` /// let mut vec = vec!["hello"]; @@ -390,7 +391,7 @@ impl Vec { /// `(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 Vec { /// Returns the number of elements the vector can hold without /// reallocating. /// - /// # Example + /// # Examples /// /// ``` /// let vec: Vec = Vec::with_capacity(10); @@ -666,7 +667,7 @@ impl Vec { /// /// Panics if the new capacity overflows `uint`. /// - /// # Example + /// # Examples /// /// ``` /// let mut vec: Vec = vec![1]; @@ -704,7 +705,7 @@ impl Vec { /// /// Panics if the new capacity overflows `uint`. /// - /// # Example + /// # Examples /// /// ``` /// let mut vec: Vec = vec![1]; @@ -725,7 +726,7 @@ impl Vec { /// 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 = Vec::with_capacity(10); @@ -778,7 +779,7 @@ impl Vec { /// 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 @@ impl Vec { /// Returns a mutable slice of the elements of `self`. /// - /// # Example + /// # Examples /// /// ``` /// fn foo(slice: &mut [int]) {} @@ -823,7 +824,7 @@ impl Vec { /// 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 @@ impl Vec { /// 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 @@ impl Vec { /// /// Returns `None` if `index` is out of bounds. /// - /// # Example + /// # Examples + /// /// ``` /// let mut v = vec!["foo", "bar", "baz", "qux"]; /// @@ -906,7 +908,7 @@ impl Vec { /// 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 @@ impl Vec { /// 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 @@ impl Vec { /// 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 @@ impl Vec { /// 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 @@ impl Vec { /// /// 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 @@ impl Vec { /// 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 @@ impl Vec { /// Clears the vector, removing all values. /// - /// # Example + /// # Examples /// /// ``` /// let mut v = vec![1i, 2, 3]; @@ -1108,7 +1110,7 @@ impl Vec { /// Return the number of elements in the vector /// - /// # Example + /// # Examples /// /// ``` /// let a = vec![1i, 2, 3]; @@ -1120,7 +1122,7 @@ impl Vec { /// Returns true if the vector contains no elements /// - /// # Example + /// # Examples /// /// ``` /// let mut v = Vec::new(); @@ -1155,7 +1157,7 @@ impl Vec { /// /// If the vector is sorted, this removes all duplicates. /// - /// # Example + /// # Examples /// /// ``` /// let mut vec = vec![1i, 2, 2, 3, 2]; @@ -1251,7 +1253,7 @@ impl Vec { impl AsSlice for Vec { /// Returns a slice into `self`. /// - /// # Example + /// # Examples /// /// ``` /// fn foo(slice: &[int]) {} @@ -1555,7 +1557,7 @@ impl Vec { /// 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]; diff --git a/src/libcollections/vec_map.rs b/src/libcollections/vec_map.rs index 97b80108d766e..968be982be4da 100644 --- a/src/libcollections/vec_map.rs +++ b/src/libcollections/vec_map.rs @@ -30,7 +30,7 @@ use hash::Hash; /// A map optimized for small integer keys. /// -/// # Example +/// # Examples /// /// ``` /// use std::collections::VecMap; @@ -92,7 +92,7 @@ impl > Hash for VecMap { impl VecMap { /// Creates an empty `VecMap`. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::VecMap; @@ -104,7 +104,7 @@ impl VecMap { /// Creates an empty `VecMap` with space for at least `capacity` /// elements before resizing. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::VecMap; @@ -118,7 +118,7 @@ impl VecMap { /// Returns the number of elements the `VecMap` can hold without /// reallocating. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::VecMap; @@ -148,7 +148,7 @@ impl VecMap { /// 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 @@ impl VecMap { /// 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 @@ impl VecMap { /// 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 @@ impl VecMap { /// Return the number of elements in the map. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::VecMap; @@ -252,7 +252,7 @@ impl VecMap { /// Return true if the map contains no elements. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::VecMap; @@ -269,7 +269,7 @@ impl VecMap { /// Clears the map, removing all key-value pairs. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::VecMap; @@ -290,7 +290,7 @@ impl VecMap { /// Returns a reference to the value corresponding to the key. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::VecMap; @@ -314,7 +314,7 @@ impl VecMap { /// Returns true if the map contains a value for the specified key. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::VecMap; @@ -338,7 +338,7 @@ impl VecMap { /// Returns a mutable reference to the value corresponding to the key. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::VecMap; @@ -372,7 +372,7 @@ impl VecMap { /// 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 @@ impl VecMap { /// 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 VecMap { /// 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 @@ impl VecMap { /// Otherwise, sets the value to `newval`. /// Returns `true` if the key did not already exist in the map. /// - /// # Example + /// # Examples /// /// ``` /// use std::collections::VecMap;