Skip to content

Commit 3a9b4e5

Browse files
GankraManishearth
authored andcommitted
fix outdated docs
Conflicts: src/libstd/collections/mod.rs
1 parent e5f2524 commit 3a9b4e5

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/libstd/collections/mod.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
//! all the contents of the collection.
210210
//!
211211
//! ```
212-
//! let vec = vec![1u, 2, 3, 4];
212+
//! let vec = vec![1, 2, 3, 4];
213213
//! for x in vec.iter() {
214214
//! println!("vec contained {}", x);
215215
//! }
@@ -219,7 +219,7 @@
219219
//! This is great for mutating all the contents of the collection.
220220
//!
221221
//! ```
222-
//! let mut vec = vec![1u, 2, 3, 4];
222+
//! let mut vec = vec![1, 2, 3, 4];
223223
//! for x in vec.iter_mut() {
224224
//! *x += 1;
225225
//! }
@@ -234,15 +234,15 @@
234234
//! previous section to do this as efficiently as possible.
235235
//!
236236
//! ```
237-
//! let mut vec1 = vec![1u, 2, 3, 4];
238-
//! let vec2 = vec![10u, 20, 30, 40];
237+
//! let mut vec1 = vec![1, 2, 3, 4];
238+
//! let vec2 = vec![10, 20, 30, 40];
239239
//! vec1.extend(vec2.into_iter());
240240
//! ```
241241
//!
242242
//! ```
243243
//! use std::collections::RingBuf;
244244
//!
245-
//! let vec = vec![1u, 2, 3, 4];
245+
//! let vec = vec![1, 2, 3, 4];
246246
//! let buf: RingBuf<uint> = vec.into_iter().collect();
247247
//! ```
248248
//!
@@ -253,7 +253,7 @@
253253
//! iterators as the way to iterate over them in reverse order.
254254
//!
255255
//! ```
256-
//! let vec = vec![1u, 2, 3, 4];
256+
//! let vec = vec![1, 2, 3, 4];
257257
//! for x in vec.iter().rev() {
258258
//! println!("vec contained {}", x);
259259
//! }
@@ -326,7 +326,7 @@
326326
//! #### Tracking the inebriation of customers at a bar
327327
//!
328328
//! ```
329-
//! use std::collections::btree_map::{BTreeMap, Occupied, Vacant};
329+
//! use std::collections::btree_map::{BTreeMap, Entry};
330330
//!
331331
//! // A client of the bar. They have an id and a blood alcohol level.
332332
//! struct Person { id: u32, blood_alcohol: f32 };
@@ -341,8 +341,8 @@
341341
//! // If this is the first time we've seen this customer, initialize them
342342
//! // with no blood alcohol. Otherwise, just retrieve them.
343343
//! let person = match blood_alcohol.entry(id) {
344-
//! Vacant(entry) => entry.insert(Person{id: id, blood_alcohol: 0.0}),
345-
//! Occupied(entry) => entry.into_mut(),
344+
//! Entry::Vacant(entry) => entry.insert(Person{id: id, blood_alcohol: 0.0}),
345+
//! Entry::Occupied(entry) => entry.into_mut(),
346346
//! };
347347
//!
348348
//! // Reduce their blood alcohol level. It takes time to order and drink a beer!

0 commit comments

Comments
 (0)