Skip to content

Commit 1283044

Browse files
committed
Clean up HashSet Examples
1 parent 6814c2f commit 1283044

File tree

1 file changed

+5
-5
lines changed
  • src/libstd/collections/hash

1 file changed

+5
-5
lines changed

src/libstd/collections/hash/set.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ use super::state::HashState;
6666
/// books.insert("The Great Gatsby");
6767
///
6868
/// // Check for a specific one.
69-
/// if !books.contains(&("The Winds of Winter")) {
69+
/// if !books.contains("The Winds of Winter") {
7070
/// println!("We have {} books, but The Winds of Winter ain't one.",
7171
/// books.len());
7272
/// }
7373
///
7474
/// // Remove a book.
75-
/// books.remove(&"The Odyssey");
75+
/// books.remove("The Odyssey");
7676
///
7777
/// // Iterate over everything.
78-
/// for book in books.iter() {
79-
/// println!("{}", *book);
78+
/// for book in &books {
79+
/// println!("{}", book);
8080
/// }
8181
/// ```
8282
///
@@ -100,7 +100,7 @@ use super::state::HashState;
100100
/// vikings.insert(Viking { name: "Harald", power: 8 });
101101
///
102102
/// // Use derived implementation to print the vikings.
103-
/// for x in vikings.iter() {
103+
/// for x in &vikings {
104104
/// println!("{:?}", x);
105105
/// }
106106
/// ```

0 commit comments

Comments
 (0)