mirror of
https://github.com/rust-lang/rustlings
synced 2024-11-10 14:44:25 +00:00
Remove unneeded Arc
This commit is contained in:
parent
d8ecf4bc2d
commit
71700c506c
1 changed files with 4 additions and 8 deletions
|
@ -27,22 +27,18 @@ impl Queue {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn send_tx(q: Queue, tx: mpsc::Sender<u32>) -> () {
|
fn send_tx(q: Queue, tx: mpsc::Sender<u32>) -> () {
|
||||||
let qc = Arc::new(q);
|
|
||||||
let qc1 = Arc::clone(&qc);
|
|
||||||
let qc2 = Arc::clone(&qc);
|
|
||||||
|
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
for val in &qc1.first_half {
|
for val in q.first_half {
|
||||||
println!("sending {:?}", val);
|
println!("sending {:?}", val);
|
||||||
tx.send(*val).unwrap();
|
tx.send(val).unwrap();
|
||||||
thread::sleep(Duration::from_secs(1));
|
thread::sleep(Duration::from_secs(1));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
thread::spawn(move || {
|
thread::spawn(move || {
|
||||||
for val in &qc2.second_half {
|
for val in q.second_half {
|
||||||
println!("sending {:?}", val);
|
println!("sending {:?}", val);
|
||||||
tx.send(*val).unwrap();
|
tx.send(val).unwrap();
|
||||||
thread::sleep(Duration::from_secs(1));
|
thread::sleep(Duration::from_secs(1));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue