about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDevin R <devin.ragotzy@gmail.com>2019-11-30 08:57:33 -0500
committerDevin R <devin.ragotzy@gmail.com>2019-11-30 08:57:33 -0500
commitb67d6c7e1234a7227d4f903fb218a4f8a226c9f4 (patch)
tree7f07ab3dacc6d076914e02492e1b31681b6074e7
parent71abce1e5d99f37d52bd9b3943db980119ff286b (diff)
downloadrust-b67d6c7e1234a7227d4f903fb218a4f8a226c9f4.tar.gz
rust-b67d6c7e1234a7227d4f903fb218a4f8a226c9f4.zip
add example to move
-rw-r--r--src/libstd/keyword_docs.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/keyword_docs.rs b/src/libstd/keyword_docs.rs
index 6bc0af47be5..24683e36b88 100644
--- a/src/libstd/keyword_docs.rs
+++ b/src/libstd/keyword_docs.rs
@@ -875,7 +875,10 @@ mod mod_keyword { }
 /// variables, when `move` is used the closures is represented by the `FnOnce` trait.
 /// 
 /// ```rust
-/// 
+/// let capture = "hello";
+/// let closure = move || {
+///     println!("we say {}", capture);
+/// };
 /// ```
 /// 
 /// `move` is often used when [threads] are involved.