mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-05-01 02:38:35 +08:00
11 lines
214 B
Rust
Executable File
11 lines
214 B
Rust
Executable File
use std::thread;
|
|
|
|
fn main() {
|
|
let list = vec![1, 2, 3];
|
|
println!("Before defining closure: {:?}", list);
|
|
|
|
thread::spawn(move || println!("From thread: {:?}", list))
|
|
.join()
|
|
.unwrap();
|
|
}
|