drop_guard 0.3.0

The drop_guard crate enables you to implement the Drop trait on any type. So you can run a closure on any value running out of scope.
Documentation
extern crate threadpool;

use drop_guard::guard;
use threadpool::ThreadPool;

fn main() {
    a_work_function();
    println!("\nAll done");
}

fn a_work_function() {
    let pool = ThreadPool::new(4);
    let pool = guard(pool, |pool| pool.join());

    for i in 0..8 {
        pool.execute(move || print!("{} ", i));
    }

    println!("Waiting for threads ...");
}