Skip to content

Commit 4815dde

Browse files
committed
Simplify 'product' factorial example
1 parent d106808 commit 4815dde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/iter/iterator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,7 @@ pub trait Iterator {
23582358
///
23592359
/// ```
23602360
/// fn factorial(n: u32) -> u32 {
2361-
/// (1..).take_while(|&i| i <= n).product()
2361+
/// (1..=n).product()
23622362
/// }
23632363
/// assert_eq!(factorial(0), 1);
23642364
/// assert_eq!(factorial(1), 1);

0 commit comments

Comments
 (0)