Stop using the deprecated Thunk API.

This commit is contained in:
Ms2ger 2015-06-26 22:45:32 +02:00
parent 995985b985
commit 079049cfac
2 changed files with 3 additions and 4 deletions

View file

@ -16,7 +16,6 @@
#![feature(slice_extras)]
#![feature(step_by)]
#![feature(step_trait)]
#![feature(thunk)]
#![feature(zero_one)]
#![plugin(string_cache_plugin)]

View file

@ -16,12 +16,12 @@
//
use task::spawn_named;
use std::boxed::FnBox;
use std::sync::{Arc, Mutex};
use std::sync::mpsc::{channel, Sender, Receiver};
use std::thunk::Thunk;
pub struct TaskPool {
tx: Sender<Thunk<'static, ()>>,
tx: Sender<Box<FnBox() + Send + 'static>>,
}
impl TaskPool {
@ -40,7 +40,7 @@ impl TaskPool {
return TaskPool { tx: tx };
fn worker(rx: &Mutex<Receiver<Thunk<()>>>) {
fn worker(rx: &Mutex<Receiver<Box<FnBox() + Send + 'static>>>) {
loop {
let job = rx.lock().unwrap().recv();
match job {