Removed commented main functions entirely. This fits in with other examples in the Closures section

This commit is contained in:
Bunts Thy Unholy 2016-10-31 23:41:38 +11:00
parent 32fb2527d9
commit 8483732c9a

View File

@ -511,12 +511,10 @@ fn factory() -> Box<Fn(i32) -> i32> {
Box::new(|x| x + num)
}
# fn main() {
let f = factory();
let answer = f(1);
assert_eq!(6, answer);
# }
```
Theres just one last problem:
@ -542,12 +540,10 @@ fn factory() -> Box<Fn(i32) -> i32> {
Box::new(move |x| x + num)
}
# fn main() {
let f = factory();
let answer = f(1);
assert_eq!(6, answer);
# }
```
By making the inner closure a `move Fn`, we create a new stack frame for our