Skip to content

Commit 0eb79f7

Browse files
committed
docs: fix incorrect max length in take_while example
1 parent d3745a7 commit 0eb79f7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rust-patterns-book/src/ch08-functional-vs-imperative-when-elegance-wins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ let samples: Vec<f64> = std::iter::from_fn(|| Some(random()))
351351
```
352352

353353
But `take_while` *excludes* the element that fails the predicate, producing anywhere from
354-
zero to nine elements instead of the guaranteed-at-least-one the imperative version provides. You can work around it with `scan` or `chain`, but the imperative version
354+
zero to ten elements instead of the guaranteed-at-least-one the imperative version provides. You can work around it with `scan` or `chain`, but the imperative version
355355
is clearer.
356356

357357
**When scoped mutability genuinely wins:**

0 commit comments

Comments
 (0)