From 0020ad1e97a9eca8c80c7ae643cd0538082cdceb Mon Sep 17 00:00:00 2001 From: Jakob Gillich Date: Mon, 17 Nov 2014 20:10:16 +0100 Subject: [PATCH] TaskPool updates --- examples/hello.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/hello.rs b/examples/hello.rs index 0c36c8d0..6d58c529 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -6,10 +6,10 @@ use std::io::net::ip::Ipv4Addr; static PHRASE: &'static [u8] = b"Hello World!"; fn hyper_handle(mut incoming: hyper::server::Incoming) { - let mut pool = TaskPool::new(100, || { proc(_) { } }); + let mut pool = TaskPool::new(100); for conn in incoming { - pool.execute(proc(_) { + pool.execute(proc() { let (_, res) = conn.open().unwrap(); let mut res = res.start().unwrap(); res.write(PHRASE).unwrap(); @@ -21,4 +21,3 @@ fn hyper_handle(mut incoming: hyper::server::Incoming) { fn main() { hyper::Server::http(Ipv4Addr(127, 0, 0, 1), 3000).listen(hyper_handle).unwrap(); } -