提交 804f024e 编写于 作者: A Adolfo Ochagavía

Simplify sample code for {Option, Result}::iter_mut

Fixes #28431
上级 1fe126af
......@@ -541,7 +541,7 @@ pub fn iter(&self) -> Iter<T> {
/// ```
/// let mut x = Some(4);
/// match x.iter_mut().next() {
/// Some(&mut ref mut v) => *v = 42,
/// Some(v) => *v = 42,
/// None => {},
/// }
/// assert_eq!(x, Some(42));
......
......@@ -538,7 +538,7 @@ pub fn iter(&self) -> Iter<T> {
/// ```
/// let mut x: Result<u32, &str> = Ok(7);
/// match x.iter_mut().next() {
/// Some(&mut ref mut x) => *x = 40,
/// Some(v) => *v = 40,
/// None => {},
/// }
/// assert_eq!(x, Ok(40));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册