This commit is contained in:
Shautvast 2026-02-09 20:05:08 +01:00
parent 8d101ee6e9
commit 5795b74d8e

View file

@ -6,7 +6,7 @@ use std::thread;
static GET: &'static [u8] = b"GET / HTTP/1.1\r\n";
pub struct ThreadPool {
threads: Vec<thread::JoinHandle<()>>,
}
impl ThreadPool {
@ -15,9 +15,13 @@ impl ThreadPool {
/// # Panics
///
/// The `new` function panics if the size is zero
pub fn new(size: usize) -> ThreadPool {
pub fn new(size: usize) -> Self {
assert!(size > 0);
Self{}
let threads = Vec::with_capacity(size);
for _ in 0..size {
}
Self {threads}
}
}