Skip to content

Commit

Permalink
Simplify 'product' factorial example
Browse files Browse the repository at this point in the history
  • Loading branch information
timvisee committed Jan 14, 2019
1 parent d106808 commit d808f93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/iter/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2358,7 +2358,7 @@ pub trait Iterator {
///
/// ```
/// 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);
Expand Down

0 comments on commit d808f93

Please sign in to comment.