Skip to content

Commit 32fb252

Browse files
committed
Commented out final 'main' function in order to fit within pattern of other examples and prevent incorrect indentation
1 parent 4497196 commit 32fb252

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/doc/book/closures.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ fn factory() -> Box<Fn(i32) -> i32> {
510510
511511
Box::new(|x| x + num)
512512
}
513+
513514
# fn main() {
514515
let f = factory();
515516
@@ -540,12 +541,13 @@ fn factory() -> Box<Fn(i32) -> i32> {
540541

541542
Box::new(move |x| x + num)
542543
}
543-
fn main() {
544+
545+
# fn main() {
544546
let f = factory();
545547

546548
let answer = f(1);
547549
assert_eq!(6, answer);
548-
}
550+
# }
549551
```
550552

551553
By making the inner closure a `move Fn`, we create a new stack frame for our

0 commit comments

Comments
 (0)