about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBunts Thy Unholy <bunts@hhd.com.au>2016-10-31 22:45:03 +1100
committerBunts Thy Unholy <bunts@hhd.com.au>2016-10-31 22:45:03 +1100
commit32fb2527d99f76b4bd41e7f4f0de5975c4ec7228 (patch)
treeca97d91956fbb8beb763adadd3240f957cbb1a4c
parent4497196ba56e5839bf4ef674851fd06d942c5544 (diff)
downloadrust-32fb2527d99f76b4bd41e7f4f0de5975c4ec7228.tar.gz
rust-32fb2527d99f76b4bd41e7f4f0de5975c4ec7228.zip
Commented out final 'main' function in order to fit within pattern of other examples and prevent incorrect indentation
-rw-r--r--src/doc/book/closures.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/doc/book/closures.md b/src/doc/book/closures.md
index 3ed85c1a90b..b306ce5db16 100644
--- a/src/doc/book/closures.md
+++ b/src/doc/book/closures.md
@@ -510,6 +510,7 @@ fn factory() -> Box<Fn(i32) -> i32> {
 
     Box::new(|x| x + num)
 }
+
 # fn main() {
 let f = factory();
 
@@ -540,12 +541,13 @@ fn factory() -> Box<Fn(i32) -> i32> {
 
     Box::new(move |x| x + num)
 }
-fn main() {
+
+# 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