Skip to content

Commit 8483732

Browse files
committed
Removed commented main functions entirely. This fits in with other examples in the Closures section
1 parent 32fb252 commit 8483732

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

src/doc/book/closures.md

-4
Original file line numberDiff line numberDiff line change
@@ -511,12 +511,10 @@ fn factory() -> Box<Fn(i32) -> i32> {
511511
Box::new(|x| x + num)
512512
}
513513
514-
# fn main() {
515514
let f = factory();
516515
517516
let answer = f(1);
518517
assert_eq!(6, answer);
519-
# }
520518
```
521519

522520
There’s just one last problem:
@@ -542,12 +540,10 @@ fn factory() -> Box<Fn(i32) -> i32> {
542540
Box::new(move |x| x + num)
543541
}
544542

545-
# fn main() {
546543
let f = factory();
547544

548545
let answer = f(1);
549546
assert_eq!(6, answer);
550-
# }
551547
```
552548

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

0 commit comments

Comments
 (0)