Skip to content

Commit

Permalink
collections: Clean up feature flags doc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrik Sverdrup committed May 19, 2015
1 parent 4a53456 commit 93701b3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 33 deletions.
5 changes: 1 addition & 4 deletions src/libcollections/btree/map.rs
Expand Up @@ -1291,14 +1291,13 @@ impl<K, V> BTreeMap<K, V> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeMap;
///
/// let mut a = BTreeMap::new();
/// a.insert(1, "a");
/// a.insert(2, "b");
///
/// let keys: Vec<usize> = a.keys().cloned().collect();
/// let keys: Vec<_> = a.keys().cloned().collect();
/// assert_eq!(keys, [1, 2]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -1314,7 +1313,6 @@ impl<K, V> BTreeMap<K, V> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeMap;
///
/// let mut a = BTreeMap::new();
Expand Down Expand Up @@ -1555,7 +1553,6 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// use std::collections::BTreeMap;
///
/// let mut count: BTreeMap<&str, usize> = BTreeMap::new();
Expand Down
22 changes: 6 additions & 16 deletions src/libcollections/btree/set.rs
Expand Up @@ -115,7 +115,6 @@ impl<T> BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeSet;
///
/// let set: BTreeSet<usize> = [1, 2, 3, 4].iter().cloned().collect();
Expand All @@ -124,7 +123,7 @@ impl<T> BTreeSet<T> {
/// println!("{}", x);
/// }
///
/// let v: Vec<usize> = set.iter().cloned().collect();
/// let v: Vec<_> = set.iter().cloned().collect();
/// assert_eq!(v, [1, 2, 3, 4]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -171,7 +170,6 @@ impl<T: Ord> BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeSet;
///
/// let mut a = BTreeSet::new();
Expand All @@ -182,7 +180,7 @@ impl<T: Ord> BTreeSet<T> {
/// b.insert(2);
/// b.insert(3);
///
/// let diff: Vec<usize> = a.difference(&b).cloned().collect();
/// let diff: Vec<_> = a.difference(&b).cloned().collect();
/// assert_eq!(diff, [1]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -195,7 +193,6 @@ impl<T: Ord> BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeSet;
///
/// let mut a = BTreeSet::new();
Expand All @@ -206,7 +203,7 @@ impl<T: Ord> BTreeSet<T> {
/// b.insert(2);
/// b.insert(3);
///
/// let sym_diff: Vec<usize> = a.symmetric_difference(&b).cloned().collect();
/// let sym_diff: Vec<_> = a.symmetric_difference(&b).cloned().collect();
/// assert_eq!(sym_diff, [1, 3]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -220,7 +217,6 @@ impl<T: Ord> BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeSet;
///
/// let mut a = BTreeSet::new();
Expand All @@ -231,7 +227,7 @@ impl<T: Ord> BTreeSet<T> {
/// b.insert(2);
/// b.insert(3);
///
/// let intersection: Vec<usize> = a.intersection(&b).cloned().collect();
/// let intersection: Vec<_> = a.intersection(&b).cloned().collect();
/// assert_eq!(intersection, [2]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -245,7 +241,6 @@ impl<T: Ord> BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeSet;
///
/// let mut a = BTreeSet::new();
Expand All @@ -254,7 +249,7 @@ impl<T: Ord> BTreeSet<T> {
/// let mut b = BTreeSet::new();
/// b.insert(2);
///
/// let union: Vec<usize> = a.union(&b).cloned().collect();
/// let union: Vec<_> = a.union(&b).cloned().collect();
/// assert_eq!(union, [1, 2]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -318,7 +313,6 @@ impl<T: Ord> BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeSet;
///
/// let set: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
Expand All @@ -336,7 +330,6 @@ impl<T: Ord> BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeSet;
///
/// let a: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
Expand All @@ -358,7 +351,6 @@ impl<T: Ord> BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeSet;
///
/// let sup: BTreeSet<_> = [1, 2, 3].iter().cloned().collect();
Expand Down Expand Up @@ -401,7 +393,6 @@ impl<T: Ord> BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeSet;
///
/// let sub: BTreeSet<_> = [1, 2].iter().cloned().collect();
Expand Down Expand Up @@ -483,12 +474,11 @@ impl<T> IntoIterator for BTreeSet<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::BTreeSet;
///
/// let set: BTreeSet<usize> = [1, 2, 3, 4].iter().cloned().collect();
///
/// let v: Vec<usize> = set.into_iter().collect();
/// let v: Vec<_> = set.into_iter().collect();
/// assert_eq!(v, [1, 2, 3, 4]);
/// ```
fn into_iter(self) -> IntoIter<T> {
Expand Down
5 changes: 0 additions & 5 deletions src/libcollections/linked_list.rs
Expand Up @@ -230,7 +230,6 @@ impl<T> LinkedList<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// use std::collections::LinkedList;
///
/// let mut a = LinkedList::new();
Expand Down Expand Up @@ -473,7 +472,6 @@ impl<T> LinkedList<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// use std::collections::LinkedList;
///
/// let mut dl = LinkedList::new();
Expand Down Expand Up @@ -521,7 +519,6 @@ impl<T> LinkedList<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// use std::collections::LinkedList;
///
/// let mut d = LinkedList::new();
Expand All @@ -540,7 +537,6 @@ impl<T> LinkedList<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// use std::collections::LinkedList;
///
/// let mut d = LinkedList::new();
Expand All @@ -566,7 +562,6 @@ impl<T> LinkedList<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// use std::collections::LinkedList;
///
/// let mut d = LinkedList::new();
Expand Down
2 changes: 0 additions & 2 deletions src/libcollections/slice.rs
Expand Up @@ -529,7 +529,6 @@ impl<T> [T] {
/// found; the fourth could match any position in `[1,4]`.
///
/// ```rust
/// # #![feature(core)]
/// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
///
/// let seek = 13;
Expand Down Expand Up @@ -865,7 +864,6 @@ impl<T> [T] {
/// found; the fourth could match any position in `[1,4]`.
///
/// ```rust
/// # #![feature(core)]
/// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
///
/// assert_eq!(s.binary_search(&13), Ok(9));
Expand Down
6 changes: 0 additions & 6 deletions src/libcollections/vec_deque.rs
Expand Up @@ -247,7 +247,6 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand Down Expand Up @@ -275,7 +274,6 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// use std::collections::VecDeque;
///
/// let buf: VecDeque<i32> = VecDeque::with_capacity(10);
Expand All @@ -299,7 +297,6 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// use std::collections::VecDeque;
///
/// let mut buf: VecDeque<i32> = vec![1].into_iter().collect();
Expand All @@ -321,7 +318,6 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(collections)]
/// use std::collections::VecDeque;
///
/// let mut buf: VecDeque<i32> = vec![1].into_iter().collect();
Expand Down Expand Up @@ -508,7 +504,6 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand All @@ -533,7 +528,6 @@ impl<T> VecDeque<T> {
/// # Examples
///
/// ```
/// # #![feature(core)]
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand Down

0 comments on commit 93701b3

Please sign in to comment.