Skip to content

Commit 40c146c

Browse files
authored
Rollup merge of #94551 - darnuria:doc-map-backstick, r=dtolnay
Doc: Fix use of quote instead of backstick in Adapter::map. A little commit to fix documentation rendering and semantics in https://doc.rust-lang.org/std/iter/struct.Map.html#notes-about-side-effects `"` where used around an expression instead \`. Screenshot on doc.rust-lang.org: ![2022-03-03 11-21-43_backstick](https://user-images.githubusercontent.com/2827553/156546536-569b7692-7ac4-4388-8e93-c1628ddc6a0f.png) Looking forward: Maybe reworking the doc to use assert_eq like the upper paragraph: ``` let v: Vec<i32> = vec![1, 2, 3].into_iter().map(|x| x + 1).rev().collect(); assert_eq!(v, [4, 3, 2]); ```
2 parents 835eaaa + 37c1eb0 commit 40c146c

File tree

1 file changed

+1
-1
lines changed
  • library/core/src/iter/adapters

1 file changed

+1
-1
lines changed

library/core/src/iter/adapters/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use crate::ops::Try;
3838
/// }
3939
/// ```
4040
///
41-
/// This will print "('a', 1), ('b', 2), ('c', 3)".
41+
/// This will print `('a', 1), ('b', 2), ('c', 3)`.
4242
///
4343
/// Now consider this twist where we add a call to `rev`. This version will
4444
/// print `('c', 1), ('b', 2), ('a', 3)`. Note that the letters are reversed,

0 commit comments

Comments
 (0)