Skip to content

Commit b67d6c7

Browse files
committed
add example to move
1 parent 71abce1 commit b67d6c7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libstd/keyword_docs.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,10 @@ mod mod_keyword { }
875875
/// variables, when `move` is used the closures is represented by the `FnOnce` trait.
876876
///
877877
/// ```rust
878-
///
878+
/// let capture = "hello";
879+
/// let closure = move || {
880+
/// println!("we say {}", capture);
881+
/// };
879882
/// ```
880883
///
881884
/// `move` is often used when [threads] are involved.

0 commit comments

Comments
 (0)