diff --git a/ci/dictionary.txt b/ci/dictionary.txt index 3a780fd7ad..a910123062 100644 --- a/ci/dictionary.txt +++ b/ci/dictionary.txt @@ -160,7 +160,6 @@ Filesystem filesystem's filesystems Firefox -FnBox FnMut FnOnce formatter diff --git a/src/ch20-03-graceful-shutdown-and-cleanup.md b/src/ch20-03-graceful-shutdown-and-cleanup.md index f36fa026ee..3a3c14f707 100644 --- a/src/ch20-03-graceful-shutdown-and-cleanup.md +++ b/src/ch20-03-graceful-shutdown-and-cleanup.md @@ -450,17 +450,7 @@ pub struct ThreadPool { sender: mpsc::Sender, } -trait FnBox { - fn call_box(self: Box); -} - -impl FnBox for F { - fn call_box(self: Box) { - (*self)() - } -} - -type Job = Box; +type Job = Box; impl ThreadPool { /// Create a new ThreadPool. @@ -536,7 +526,7 @@ impl Worker { Message::NewJob(job) => { println!("Worker {} got a job; executing.", id); - job.call_box(); + (job)(); }, Message::Terminate => { println!("Worker {} was told to terminate.", id);