diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index 640af748172..0ad29afbade 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -2358,7 +2358,7 @@ fn sum(self) -> S /// /// ``` /// fn factorial(n: u32) -> u32 { - /// (1..).take_while(|&i| i <= n).product() + /// (1..=n).product() /// } /// assert_eq!(factorial(0), 1); /// assert_eq!(factorial(1), 1);