Skip to content

Instantly share code, notes, and snippets.

@tomprince
Created March 17, 2016 22:03
Show Gist options
  • Save tomprince/cb95eec1692428f7fbfc to your computer and use it in GitHub Desktop.
Save tomprince/cb95eec1692428f7fbfc to your computer and use it in GitHub Desktop.
use std::thread;
use std::sync::Arc;
fn main() {
let pass = Arc::new("test".to_string());
thread::spawn({let pass = pass.clone(); move || println!("{}", pass)});
thread::spawn(move || println!("{}", pass));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment