|
33 | 33 | //! translated to the `loop` below. |
34 | 34 | //! |
35 | 35 | //! ``` |
36 | | -//! let values = vec![1i, 2, 3]; |
| 36 | +//! let values = vec![1, 2, 3]; |
37 | 37 | //! |
38 | 38 | //! // "Syntactical sugar" taking advantage of an iterator |
39 | 39 | //! for &x in values.iter() { |
@@ -615,7 +615,7 @@ pub trait IteratorExt: Iterator + Sized { |
615 | 615 | /// # Examples |
616 | 616 | /// |
617 | 617 | /// ``` |
618 | | - /// let a = [1i, 2, 3, 4, 5]; |
| 618 | + /// let a = [1, 2, 3, 4, 5]; |
619 | 619 | /// assert!(a.iter().all(|x| *x > 0)); |
620 | 620 | /// assert!(!a.iter().all(|x| *x > 2)); |
621 | 621 | /// ``` |
@@ -1141,7 +1141,7 @@ pub trait AdditiveIterator<A> { |
1141 | 1141 | /// ``` |
1142 | 1142 | /// use std::iter::AdditiveIterator; |
1143 | 1143 | /// |
1144 | | - /// let a = [1i, 2, 3, 4, 5]; |
| 1144 | + /// let a = [1i32, 2, 3, 4, 5]; |
1145 | 1145 | /// let mut it = a.iter().map(|&x| x); |
1146 | 1146 | /// assert!(it.sum() == 15); |
1147 | 1147 | /// ``` |
@@ -1183,7 +1183,7 @@ pub trait MultiplicativeIterator<A> { |
1183 | 1183 | /// use std::iter::{count, MultiplicativeIterator}; |
1184 | 1184 | /// |
1185 | 1185 | /// fn factorial(n: usize) -> usize { |
1186 | | - /// count(1u, 1).take_while(|&i| i <= n).product() |
| 1186 | + /// count(1, 1).take_while(|&i| i <= n).product() |
1187 | 1187 | /// } |
1188 | 1188 | /// assert!(factorial(0) == 1); |
1189 | 1189 | /// assert!(factorial(1) == 1); |
@@ -2526,7 +2526,7 @@ pub struct Range<A> { |
2526 | 2526 | /// ``` |
2527 | 2527 | /// let array = [0, 1, 2, 3, 4]; |
2528 | 2528 | /// |
2529 | | -/// for i in range(0, 5u) { |
| 2529 | +/// for i in range(0, 5) { |
2530 | 2530 | /// println!("{}", i); |
2531 | 2531 | /// assert_eq!(i, array[i]); |
2532 | 2532 | /// } |
|
0 commit comments