Skip to content

Commit

Permalink
fix outdated docs
Browse files Browse the repository at this point in the history
Conflicts:
	src/libstd/collections/mod.rs
  • Loading branch information
Gankra authored and Manishearth committed Feb 6, 2015
1 parent e5f2524 commit 3a9b4e5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/libstd/collections/mod.rs
Expand Up @@ -209,7 +209,7 @@
//! all the contents of the collection.
//!
//! ```
//! let vec = vec![1u, 2, 3, 4];
//! let vec = vec![1, 2, 3, 4];
//! for x in vec.iter() {
//! println!("vec contained {}", x);
//! }
Expand All @@ -219,7 +219,7 @@
//! This is great for mutating all the contents of the collection.
//!
//! ```
//! let mut vec = vec![1u, 2, 3, 4];
//! let mut vec = vec![1, 2, 3, 4];
//! for x in vec.iter_mut() {
//! *x += 1;
//! }
Expand All @@ -234,15 +234,15 @@
//! previous section to do this as efficiently as possible.
//!
//! ```
//! let mut vec1 = vec![1u, 2, 3, 4];
//! let vec2 = vec![10u, 20, 30, 40];
//! let mut vec1 = vec![1, 2, 3, 4];
//! let vec2 = vec![10, 20, 30, 40];
//! vec1.extend(vec2.into_iter());
//! ```
//!
//! ```
//! use std::collections::RingBuf;
//!
//! let vec = vec![1u, 2, 3, 4];
//! let vec = vec![1, 2, 3, 4];
//! let buf: RingBuf<uint> = vec.into_iter().collect();
//! ```
//!
Expand All @@ -253,7 +253,7 @@
//! iterators as the way to iterate over them in reverse order.
//!
//! ```
//! let vec = vec![1u, 2, 3, 4];
//! let vec = vec![1, 2, 3, 4];
//! for x in vec.iter().rev() {
//! println!("vec contained {}", x);
//! }
Expand Down Expand Up @@ -326,7 +326,7 @@
//! #### Tracking the inebriation of customers at a bar
//!
//! ```
//! use std::collections::btree_map::{BTreeMap, Occupied, Vacant};
//! use std::collections::btree_map::{BTreeMap, Entry};
//!
//! // A client of the bar. They have an id and a blood alcohol level.
//! struct Person { id: u32, blood_alcohol: f32 };
Expand All @@ -341,8 +341,8 @@
//! // If this is the first time we've seen this customer, initialize them
//! // with no blood alcohol. Otherwise, just retrieve them.
//! let person = match blood_alcohol.entry(id) {
//! Vacant(entry) => entry.insert(Person{id: id, blood_alcohol: 0.0}),
//! Occupied(entry) => entry.into_mut(),
//! Entry::Vacant(entry) => entry.insert(Person{id: id, blood_alcohol: 0.0}),
//! Entry::Occupied(entry) => entry.into_mut(),
//! };
//!
//! // Reduce their blood alcohol level. It takes time to order and drink a beer!
Expand Down

0 comments on commit 3a9b4e5

Please sign in to comment.