extern crate shh;
use std::thread;
fn main() {
println!("you will see this");
shh::stdout().unwrap(); println!("and expect not to see this, but you will");
println!("you will see this");
let shh = shh::stdout().unwrap(); println!("and expect not to see this");
drop(shh); println!("now it works!");
let shh = shh::stdout().unwrap();
println!("you won't see this",);
thread::spawn(move || {
let _move_it = shh;
println!("nor this",);
})
.join()
.unwrap();
println!("you will see this thread though",);
let shh = shh::stdout().unwrap();
println!("you won't see this",);
thread::spawn(move || {
println!("nor this",);
})
.join()
.unwrap();
println!("you also won't see this",);
drop(shh);
println!("you only see this!");
}