@@ -502,11 +502,12 @@ impl<T: ?Sized> *const T {
502502 /// let mut out = String::new();
503503 /// while ptr != end_rounded_up {
504504 /// unsafe {
505- /// write!(&mut out, "{}, ", *ptr).unwrap() ;
505+ /// write!(&mut out, "{}, ", *ptr)? ;
506506 /// }
507507 /// ptr = ptr.wrapping_offset(step);
508508 /// }
509509 /// assert_eq!(out.as_str(), "1, 3, 5, ");
510+ /// # std::fmt::Result::Ok(())
510511 /// ```
511512 #[ stable( feature = "ptr_wrapping_offset" , since = "1.16.0" ) ]
512513 #[ must_use = "returns a new pointer rather than modifying its argument" ]
@@ -1125,11 +1126,12 @@ impl<T: ?Sized> *const T {
11251126 /// let mut out = String::new();
11261127 /// while ptr != end_rounded_up {
11271128 /// unsafe {
1128- /// write!(&mut out, "{}, ", *ptr).unwrap() ;
1129+ /// write!(&mut out, "{}, ", *ptr)? ;
11291130 /// }
11301131 /// ptr = ptr.wrapping_add(step);
11311132 /// }
11321133 /// assert_eq!(out, "1, 3, 5, ");
1134+ /// # std::fmt::Result::Ok(())
11331135 /// ```
11341136 #[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
11351137 #[ must_use = "returns a new pointer rather than modifying its argument" ]
@@ -1203,11 +1205,12 @@ impl<T: ?Sized> *const T {
12031205 /// let mut out = String::new();
12041206 /// while ptr != start_rounded_down {
12051207 /// unsafe {
1206- /// write!(&mut out, "{}, ", *ptr).unwrap() ;
1208+ /// write!(&mut out, "{}, ", *ptr)? ;
12071209 /// }
12081210 /// ptr = ptr.wrapping_sub(step);
12091211 /// }
12101212 /// assert_eq!(out, "5, 3, 1, ");
1213+ /// # std::fmt::Result::Ok(())
12111214 /// ```
12121215 #[ stable( feature = "pointer_methods" , since = "1.26.0" ) ]
12131216 #[ must_use = "returns a new pointer rather than modifying its argument" ]
0 commit comments