auto merge of #19655 : jbranchaud/rust/change-example-to-examples, r=steveklabnik
@steveklabnik I got a start on this.
This commit is contained in:
commit
daa2bde2ba
@ -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].
|
||||
@ -180,7 +180,7 @@ impl<T: Ord> Default for BinaryHeap<T> {
|
||||
impl<T: Ord> BinaryHeap<T> {
|
||||
/// Creates an empty `BinaryHeap` as a max-heap.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -194,7 +194,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
/// so that the `BinaryHeap` does not have to be reallocated
|
||||
/// until it contains at least that many values.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -208,7 +208,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
/// Creates a `BinaryHeap` from a vector. This is sometimes called
|
||||
/// `heapifying` the vector.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -227,7 +227,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
/// An iterator visiting all values in underlying vector, in
|
||||
/// arbitrary order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -247,7 +247,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
/// the binary heap in arbitrary order. The binary heap cannot be used
|
||||
/// after calling this.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -266,7 +266,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
|
||||
/// Returns the greatest item in a queue, or `None` if it is empty.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -286,7 +286,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
|
||||
/// Returns the number of elements the queue can hold without reallocating.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -308,7 +308,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
///
|
||||
/// Panics if the new capacity overflows `uint`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -327,7 +327,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
///
|
||||
/// Panics if the new capacity overflows `uint`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -350,7 +350,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
/// Removes the greatest item from a queue and returns it, or `None` if it
|
||||
/// is empty.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -377,7 +377,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
|
||||
/// Pushes an item onto the queue.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -400,7 +400,7 @@ impl<T: Ord> BinaryHeap<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;
|
||||
@ -426,7 +426,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
/// an optimized fashion. The push is done regardless of whether the queue
|
||||
/// was empty.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -452,7 +452,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
/// Consumes the `BinaryHeap` and returns the underlying vector
|
||||
/// in arbitrary order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
@ -470,7 +470,7 @@ impl<T: Ord> BinaryHeap<T> {
|
||||
/// Consumes the `BinaryHeap` and returns a vector in sorted
|
||||
/// (ascending) order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BinaryHeap;
|
||||
|
@ -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<bool>` 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<bool> 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;
|
||||
|
@ -152,7 +152,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
|
||||
|
||||
/// Clears the map, removing all values.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeMap;
|
||||
@ -188,7 +188,7 @@ impl<K: Ord, V> BTreeMap<K, 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 @@ impl<K: Ord, V> BTreeMap<K, 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;
|
||||
@ -246,7 +246,7 @@ impl<K: Ord, V> BTreeMap<K, 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 @@ impl<K: Ord, V> BTreeMap<K, 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 @@ impl<K: Ord, V> BTreeMap<K, 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;
|
||||
@ -1087,7 +1087,7 @@ impl<K, V> BTreeMap<K, V> {
|
||||
|
||||
/// Gets an iterator over the keys of the map.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeMap;
|
||||
@ -1106,7 +1106,7 @@ impl<K, V> BTreeMap<K, V> {
|
||||
|
||||
/// Gets an iterator over the values of the map.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeMap;
|
||||
@ -1125,7 +1125,7 @@ impl<K, V> BTreeMap<K, V> {
|
||||
|
||||
/// Return the number of elements in the map.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeMap;
|
||||
@ -1140,7 +1140,7 @@ impl<K, V> BTreeMap<K, V> {
|
||||
|
||||
/// Return true if the map contains no elements.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeMap;
|
||||
|
@ -95,7 +95,7 @@ impl<T> BTreeSet<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 @@ impl<T: Ord> BTreeSet<T> {
|
||||
|
||||
/// Visits the values representing the symmetric difference, in ascending order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeSet;
|
||||
@ -142,7 +142,7 @@ impl<T: Ord> BTreeSet<T> {
|
||||
|
||||
/// Visits the values representing the intersection, in ascending order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeSet;
|
||||
@ -166,7 +166,7 @@ impl<T: Ord> BTreeSet<T> {
|
||||
|
||||
/// Visits the values representing the union, in ascending order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeSet;
|
||||
@ -187,7 +187,7 @@ impl<T: Ord> BTreeSet<T> {
|
||||
|
||||
/// Return the number of elements in the set
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeSet;
|
||||
@ -202,7 +202,7 @@ impl<T: Ord> BTreeSet<T> {
|
||||
|
||||
/// Returns true if the set contains no elements
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeSet;
|
||||
@ -217,7 +217,7 @@ impl<T: Ord> BTreeSet<T> {
|
||||
|
||||
/// Clears the set, removing all values.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeSet;
|
||||
@ -238,7 +238,7 @@ impl<T: Ord> BTreeSet<T> {
|
||||
/// 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<T: Ord> BTreeSet<T> {
|
||||
/// 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<T: Ord> BTreeSet<T> {
|
||||
|
||||
/// Returns `true` if the set is a subset of another.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeSet;
|
||||
@ -318,7 +318,7 @@ impl<T: Ord> BTreeSet<T> {
|
||||
|
||||
/// Returns `true` if the set is a superset of another.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeSet;
|
||||
@ -343,7 +343,7 @@ impl<T: Ord> BTreeSet<T> {
|
||||
/// 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<T: Ord> BTreeSet<T> {
|
||||
/// but the ordering on the borrowed form *must* match the
|
||||
/// ordering on the value type.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::BTreeSet;
|
||||
|
@ -208,7 +208,7 @@ impl<T> DList<T> {
|
||||
///
|
||||
/// If the list is empty, does nothing.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::DList;
|
||||
@ -235,7 +235,7 @@ impl<T> DList<T> {
|
||||
///
|
||||
/// If the list is empty, does nothing.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::DList;
|
||||
@ -262,7 +262,7 @@ impl<T> DList<T> {
|
||||
///
|
||||
/// This operation should compute in O(1) time.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::DList;
|
||||
@ -303,7 +303,7 @@ impl<T> DList<T> {
|
||||
///
|
||||
/// This operation should compute in O(1) time.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::DList;
|
||||
@ -332,7 +332,7 @@ impl<T> DList<T> {
|
||||
///
|
||||
/// This operation should compute in O(N) time.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::DList;
|
||||
@ -504,7 +504,7 @@ impl<T> DList<T> {
|
||||
|
||||
/// Appends an element to the back of a list
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::DList;
|
||||
@ -528,7 +528,7 @@ impl<T> DList<T> {
|
||||
/// Removes the last element from a list and returns it, or `None` if
|
||||
/// it is empty.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::DList;
|
||||
|
@ -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;
|
||||
|
@ -136,7 +136,7 @@ impl<T> RingBuf<T> {
|
||||
|
||||
/// Retrieves an element in the `RingBuf` by index.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::RingBuf;
|
||||
@ -159,7 +159,7 @@ impl<T> RingBuf<T> {
|
||||
|
||||
/// Retrieves an element in the `RingBuf` mutably by index.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::RingBuf;
|
||||
@ -193,7 +193,7 @@ impl<T> RingBuf<T> {
|
||||
///
|
||||
/// Fails if there is no element with either index.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::RingBuf;
|
||||
@ -219,7 +219,7 @@ impl<T> RingBuf<T> {
|
||||
/// Returns the number of elements the `RingBuf` can hold without
|
||||
/// reallocating.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -242,7 +242,7 @@ impl<T> RingBuf<T> {
|
||||
///
|
||||
/// Panics if the new capacity overflows `uint`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -263,7 +263,7 @@ impl<T> RingBuf<T> {
|
||||
///
|
||||
/// Panics if the new capacity overflows `uint`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -341,7 +341,7 @@ impl<T> RingBuf<T> {
|
||||
|
||||
/// Returns a front-to-back iterator.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::RingBuf;
|
||||
@ -364,7 +364,7 @@ impl<T> RingBuf<T> {
|
||||
|
||||
/// Returns a front-to-back iterator which returns mutable references.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::RingBuf;
|
||||
@ -401,7 +401,7 @@ impl<T> RingBuf<T> {
|
||||
|
||||
/// Returns the number of elements in the `RingBuf`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -416,7 +416,7 @@ impl<T> RingBuf<T> {
|
||||
|
||||
/// Returns true if the buffer contains no elements
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -431,7 +431,7 @@ impl<T> RingBuf<T> {
|
||||
|
||||
/// Clears the buffer, removing all values.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -451,7 +451,7 @@ impl<T> RingBuf<T> {
|
||||
/// Provides a reference to the front element, or `None` if the sequence is
|
||||
/// empty.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -471,7 +471,7 @@ impl<T> RingBuf<T> {
|
||||
/// Provides a mutable reference to the front element, or `None` if the
|
||||
/// sequence is empty.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -495,7 +495,7 @@ impl<T> RingBuf<T> {
|
||||
/// Provides a reference to the back element, or `None` if the sequence is
|
||||
/// empty.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -515,7 +515,7 @@ impl<T> RingBuf<T> {
|
||||
/// Provides a mutable reference to the back element, or `None` if the
|
||||
/// sequence is empty.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -540,7 +540,7 @@ impl<T> RingBuf<T> {
|
||||
/// Removes the first element and returns it, or `None` if the sequence is
|
||||
/// empty.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -566,7 +566,7 @@ impl<T> RingBuf<T> {
|
||||
|
||||
/// Inserts an element first in the sequence.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::RingBuf;
|
||||
@ -596,7 +596,7 @@ impl<T> RingBuf<T> {
|
||||
|
||||
/// Appends an element to the back of a buffer
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::RingBuf;
|
||||
@ -627,7 +627,7 @@ impl<T> RingBuf<T> {
|
||||
/// Removes the last element from a buffer and returns it, or `None` if
|
||||
/// it is empty.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::collections::RingBuf;
|
||||
|
@ -301,7 +301,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];
|
||||
@ -312,7 +312,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];
|
||||
@ -571,7 +571,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];
|
||||
@ -600,7 +600,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];
|
||||
@ -625,7 +625,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];
|
||||
|
@ -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();
|
||||
@ -390,7 +390,7 @@ impl<'a> Iterator<char> for Recompositions<'a> {
|
||||
///
|
||||
/// The original string with all occurrences of `from` replaced with `to`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::str;
|
||||
@ -448,7 +448,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");
|
||||
@ -465,7 +465,7 @@ impl<'a> MaybeOwned<'a> {
|
||||
|
||||
/// Returns `true` if this `MaybeOwned` wraps a borrowed string.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ``` ignore
|
||||
/// let string = "orange";
|
||||
@ -500,7 +500,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");
|
||||
@ -517,7 +517,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";
|
||||
@ -532,7 +532,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";
|
||||
@ -716,7 +716,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,
|
||||
|
@ -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
|
||||
/// // 𝄞mus<invalid>ic<invalid>
|
||||
/// 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();
|
||||
|
@ -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<K: Ord, Sized? Q, V> IndexMut<Q, V> for TreeMap<K, V> where Q: BorrowFrom<K
|
||||
impl<K: Ord, V> TreeMap<K, V> {
|
||||
/// Creates an empty `TreeMap`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeMap;
|
||||
@ -218,7 +218,7 @@ impl<K: Ord, V> TreeMap<K, V> {
|
||||
|
||||
/// Gets a lazy iterator over the keys in the map, in ascending order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeMap;
|
||||
@ -240,7 +240,7 @@ impl<K: Ord, V> TreeMap<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 @@ impl<K: Ord, V> TreeMap<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 @@ impl<K: Ord, V> TreeMap<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 @@ impl<K: Ord, V> TreeMap<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 @@ impl<K: Ord, V> TreeMap<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 @@ impl<K: Ord, V> TreeMap<K, V> {
|
||||
|
||||
/// Gets a lazy iterator that consumes the treemap.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeMap;
|
||||
@ -393,7 +393,7 @@ impl<K: Ord, V> TreeMap<K, V> {
|
||||
|
||||
/// Return the number of elements in the map.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeMap;
|
||||
@ -408,7 +408,7 @@ impl<K: Ord, V> TreeMap<K, V> {
|
||||
|
||||
/// Return true if the map contains no elements.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeMap;
|
||||
@ -424,7 +424,7 @@ impl<K: Ord, V> TreeMap<K, V> {
|
||||
|
||||
/// Clears the map, removing all values.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeMap;
|
||||
@ -451,7 +451,7 @@ impl<K: Ord, V> TreeMap<K, 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 @@ impl<K: Ord, V> TreeMap<K, 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 @@ impl<K: Ord, V> TreeMap<K, 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 @@ impl<K: Ord, V> TreeMap<K, 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 @@ impl<K: Ord, V> TreeMap<K, 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 @@ 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
|
||||
///
|
||||
/// ```
|
||||
/// let mut t = collections::tree_map::TreeMap::new();
|
||||
@ -691,7 +691,7 @@ impl<K: Ord, V> TreeMap<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 @@ impl<K: Ord, V> TreeMap<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 @@ impl<K: Ord, V> TreeMap<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 @@ impl<K: Ord, V> TreeMap<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;
|
||||
|
@ -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<T: Ord> Default for TreeSet<T> {
|
||||
impl<T: Ord> TreeSet<T> {
|
||||
/// Creates an empty `TreeSet`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -154,7 +154,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Gets a lazy iterator over the values in the set, in ascending order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -173,7 +173,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Gets a lazy iterator over the values in the set, in descending order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -192,7 +192,7 @@ impl<T: Ord> TreeSet<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 @@ impl<T: Ord> TreeSet<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 @@ impl<T: Ord> TreeSet<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 @@ impl<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Visits the values representing the difference, in ascending order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -275,7 +275,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Visits the values representing the symmetric difference, in ascending order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -302,7 +302,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Visits the values representing the intersection, in ascending order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -326,7 +326,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Visits the values representing the union, in ascending order.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -349,7 +349,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Return the number of elements in the set
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -365,7 +365,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Returns true if the set contains no elements
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -380,7 +380,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Clears the set, removing all values.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -400,7 +400,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
/// 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<T: Ord> TreeSet<T> {
|
||||
/// 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<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Returns `true` if the set is a subset of another.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -482,7 +482,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
|
||||
/// Returns `true` if the set is a superset of another.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TreeSet;
|
||||
@ -507,7 +507,7 @@ impl<T: Ord> TreeSet<T> {
|
||||
/// 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<T: Ord> TreeSet<T> {
|
||||
/// 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<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 @@ impl<T: Ord + Clone> BitOr<TreeSet<T>, TreeSet<T>> for 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 @@ impl<T: Ord + Clone> BitAnd<TreeSet<T>, TreeSet<T>> for 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 @@ impl<T: Ord + Clone> BitXor<TreeSet<T>, TreeSet<T>> for 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;
|
||||
|
@ -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<T> Default for TrieMap<T> {
|
||||
impl<T> TrieMap<T> {
|
||||
/// Creates an empty `TrieMap`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TrieMap;
|
||||
@ -173,7 +173,7 @@ impl<T> 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 @@ impl<T> TrieMap<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 @@ impl<T> TrieMap<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 @@ impl<T> TrieMap<T> {
|
||||
|
||||
/// Return the number of elements in the map.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TrieMap;
|
||||
@ -276,7 +276,7 @@ impl<T> TrieMap<T> {
|
||||
|
||||
/// Return true if the map contains no elements.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TrieMap;
|
||||
@ -292,7 +292,7 @@ impl<T> TrieMap<T> {
|
||||
|
||||
/// Clears the map, removing all values.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TrieMap;
|
||||
@ -317,7 +317,7 @@ impl<T> TrieMap<T> {
|
||||
|
||||
/// Returns a reference to the value corresponding to the key.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TrieMap;
|
||||
@ -350,7 +350,7 @@ impl<T> TrieMap<T> {
|
||||
|
||||
/// Returns true if the map contains a value for the specified key.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TrieMap;
|
||||
@ -374,7 +374,7 @@ impl<T> TrieMap<T> {
|
||||
|
||||
/// Returns a mutable reference to the value corresponding to the key.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TrieMap;
|
||||
@ -402,7 +402,7 @@ impl<T> TrieMap<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 @@ impl<T> TrieMap<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 @@ impl<T> TrieMap<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 @@ impl<T> TrieMap<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 @@ impl<T> TrieMap<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 @@ impl<T> TrieMap<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;
|
||||
|
@ -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<uint> for TrieSet {
|
||||
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 @@ impl BitOr<TrieSet, TrieSet> for 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 @@ impl BitAnd<TrieSet, TrieSet> for 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 @@ impl BitXor<TrieSet, TrieSet> for TrieSet {
|
||||
impl Sub<TrieSet, TrieSet> for TrieSet {
|
||||
/// Returns the difference of `self` and `rhs` as a new `TrieSet`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::TrieSet;
|
||||
|
@ -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 @@ impl<T> 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 @@ impl<T> 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 @@ impl<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 @@ impl<T> 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 @@ impl<T: Clone> 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 @@ impl<T: Clone> Vec<T> {
|
||||
///
|
||||
/// Adds `n` copies of `value` to the `Vec`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let mut vec = vec!["hello"];
|
||||
@ -390,7 +391,7 @@ impl<T: Clone> Vec<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 @@ impl<T> Vec<T> {
|
||||
///
|
||||
/// Panics if the new capacity overflows `uint`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let mut vec: Vec<int> = vec![1];
|
||||
@ -704,7 +705,7 @@ impl<T> Vec<T> {
|
||||
///
|
||||
/// Panics if the new capacity overflows `uint`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let mut vec: Vec<int> = vec![1];
|
||||
@ -725,7 +726,7 @@ impl<T> Vec<T> {
|
||||
/// 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 @@ impl<T> Vec<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 @@ impl<T> Vec<T> {
|
||||
|
||||
/// Returns a mutable slice of the elements of `self`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// fn foo(slice: &mut [int]) {}
|
||||
@ -823,7 +824,7 @@ impl<T> Vec<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 @@ impl<T> Vec<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 @@ impl<T> Vec<T> {
|
||||
///
|
||||
/// Returns `None` if `index` is out of bounds.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let mut v = vec!["foo", "bar", "baz", "qux"];
|
||||
///
|
||||
@ -906,7 +908,7 @@ impl<T> Vec<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 @@ impl<T> Vec<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 @@ impl<T> Vec<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 @@ impl<T> Vec<T> {
|
||||
/// 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<T> Vec<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 @@ impl<T> Vec<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 @@ impl<T> Vec<T> {
|
||||
|
||||
/// Clears the vector, removing all values.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let mut v = vec![1i, 2, 3];
|
||||
@ -1108,7 +1110,7 @@ impl<T> Vec<T> {
|
||||
|
||||
/// Return the number of elements in the vector
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// let a = vec![1i, 2, 3];
|
||||
@ -1120,7 +1122,7 @@ impl<T> Vec<T> {
|
||||
|
||||
/// 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 @@ impl<T: PartialEq> Vec<T> {
|
||||
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];
|
||||
|
@ -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 <S: hash::Writer, T: Hash<S>> Hash<S> for VecMap<T> {
|
||||
impl<V> VecMap<V> {
|
||||
/// Creates an empty `VecMap`.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::VecMap;
|
||||
@ -104,7 +104,7 @@ impl<V> VecMap<V> {
|
||||
/// Creates an empty `VecMap` with space for at least `capacity`
|
||||
/// elements before resizing.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::VecMap;
|
||||
@ -118,7 +118,7 @@ impl<V> VecMap<V> {
|
||||
/// Returns the number of elements the `VecMap` can hold without
|
||||
/// reallocating.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::VecMap;
|
||||
@ -148,7 +148,7 @@ impl<V> VecMap<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 @@ impl<V> VecMap<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 @@ impl<V> VecMap<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 @@ impl<V> VecMap<V> {
|
||||
|
||||
/// Return the number of elements in the map.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::VecMap;
|
||||
@ -252,7 +252,7 @@ impl<V> VecMap<V> {
|
||||
|
||||
/// Return true if the map contains no elements.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::VecMap;
|
||||
@ -269,7 +269,7 @@ impl<V> VecMap<V> {
|
||||
|
||||
/// Clears the map, removing all key-value pairs.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::VecMap;
|
||||
@ -290,7 +290,7 @@ impl<V> VecMap<V> {
|
||||
|
||||
/// Returns a reference to the value corresponding to the key.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::VecMap;
|
||||
@ -314,7 +314,7 @@ impl<V> VecMap<V> {
|
||||
|
||||
/// Returns true if the map contains a value for the specified key.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::VecMap;
|
||||
@ -338,7 +338,7 @@ impl<V> VecMap<V> {
|
||||
|
||||
/// Returns a mutable reference to the value corresponding to the key.
|
||||
///
|
||||
/// # Example
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// use std::collections::VecMap;
|
||||
@ -372,7 +372,7 @@ impl<V> VecMap<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 @@ impl<V> VecMap<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 @@ 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user