Quiz · Threads · lesson 4 of 7
Quiz — values through a channel
What does the program print (lines separated by spaces)?
fn main() {
let (tx, rx) = std::sync::mpsc::channel();
std::thread::spawn(move || {
for i in 1..=3 {
tx.send(i).unwrap();
}
});
for x in rx {
println!("{x}");
}
}