camera: lint cleanup

This commit is contained in:
Bill Thiede 2021-07-18 12:14:13 -07:00
parent dbf5451070
commit 7e19d7e61b

View File

@ -243,15 +243,14 @@ impl Camera {
// Create a worker thread for each CPU core and pin the thread to the core.
let mut handles = core_ids
.into_iter()
.enumerate()
.map(|(i, id)| {
.map(|id| {
let w = Arc::clone(&world);
let c = Arc::clone(&camera);
let pixel_req_rx = pixel_req_rx.clone();
let pixel_resp_tx = pixel_resp_tx.clone();
thread::spawn(move || {
core_affinity::set_for_current(id);
render_worker(i, &c, &w, pixel_req_rx, &pixel_resp_tx);
render_worker(&c, &w, pixel_req_rx, &pixel_resp_tx);
})
})
.collect::<Vec<_>>();
@ -328,7 +327,6 @@ impl Camera {
}
fn render_worker(
tid: usize,
c: &Camera,
w: &World,
input_chan: Arc<Mutex<Receiver<Request>>>,
@ -337,8 +335,11 @@ fn render_worker(
loop {
let job = { input_chan.lock().unwrap().recv() };
match job {
Err(err) => {
eprintln!("Shutting down render_worker {}: {}", tid, err);
Err(_) => {
// From the docs:
// "The recv operation can only fail if the sending half of a
// channel (or sync_channel) is disconnected, implying that no
// further messages will ever be received."
return;
}
Ok(req) => match req {