未验证 提交 40c146ce 编写于 作者: M Matthias Krüger 提交者: GitHub

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]);
```
......@@ -38,7 +38,7 @@
/// }
/// ```
///
/// This will print "('a', 1), ('b', 2), ('c', 3)".
/// This will print `('a', 1), ('b', 2), ('c', 3)`.
///
/// Now consider this twist where we add a call to `rev`. This version will
/// print `('c', 1), ('b', 2), ('a', 3)`. Note that the letters are reversed,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册