diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 490cd5bb3fe..9b7b8368986 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -1220,10 +1220,10 @@ impl> FromIterator> for Result { /// ``` /// let v = vec![3, 2, 1, 10]; /// let mut shared = 0; - /// let res: Result, &'static str> = v.iter().map(|x: &u32| + /// let res: Result, &'static str> = v.iter().map(|x: &u32| { /// shared += x; /// x.checked_sub(2).ok_or("Underflow!") - /// ).collect(); + /// }).collect(); /// assert_eq!(res, Err("Underflow!")); /// assert_eq!(shared, 6); /// ```