@@ -250,26 +250,26 @@ fn test_resize_policy() {
250
250
/// book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.");
251
251
///
252
252
/// // check for a specific one.
253
- /// if !book_reviews.contains_key(&( "Les Misérables") ) {
253
+ /// if !book_reviews.contains_key("Les Misérables") {
254
254
/// println!("We've got {} reviews, but Les Misérables ain't one.",
255
255
/// book_reviews.len());
256
256
/// }
257
257
///
258
258
/// // oops, this review has a lot of spelling mistakes, let's delete it.
259
- /// book_reviews.remove(&( "The Adventures of Sherlock Holmes") );
259
+ /// book_reviews.remove("The Adventures of Sherlock Holmes");
260
260
///
261
261
/// // look up the values associated with some keys.
262
262
/// let to_find = ["Pride and Prejudice", "Alice's Adventure in Wonderland"];
263
- /// for book in to_find.iter() {
263
+ /// for book in & to_find {
264
264
/// match book_reviews.get(book) {
265
- /// Some(review) => println!("{}: {}", * book, * review),
266
- /// None => println!("{} is unreviewed.", * book)
265
+ /// Some(review) => println!("{}: {}", book, review),
266
+ /// None => println!("{} is unreviewed.", book)
267
267
/// }
268
268
/// }
269
269
///
270
270
/// // iterate over everything.
271
- /// for (book, review) in book_reviews.iter() {
272
- /// println!("{}: \"{}\"", * book, * review);
271
+ /// for (book, review) in & book_reviews {
272
+ /// println!("{}: \"{}\"", book, review);
273
273
/// }
274
274
/// ```
275
275
///
@@ -300,7 +300,7 @@ fn test_resize_policy() {
300
300
/// vikings.insert(Viking::new("Harald", "Iceland"), 12);
301
301
///
302
302
/// // Use derived implementation to print the status of the vikings.
303
- /// for (viking, health) in vikings.iter() {
303
+ /// for (viking, health) in & vikings {
304
304
/// println!("{:?} has {} hp", viking, health);
305
305
/// }
306
306
/// ```
0 commit comments