Rollup merge of #37495 - buntine:master, r=steveklabnik

Commented out final 'main' function in order to fit within pattern of…

… other examples and prevent incorrect indentation
This commit is contained in:
Guillaume Gomez 2016-11-01 16:15:52 +01:00 committed by GitHub
commit f5c192a4b7

View File

@ -510,12 +510,11 @@ 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:
@ -540,12 +539,11 @@ 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