1
Fork 0

add example to move

This commit is contained in:
Devin R 2019-11-30 08:57:33 -05:00
parent 71abce1e5d
commit b67d6c7e12

View file

@ -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.