This commit is contained in:
Shautvast 2026-02-09 20:01:44 +01:00
parent 24d3ee6a97
commit 8d101ee6e9

View file

@ -10,9 +10,16 @@ pub struct ThreadPool{
} }
impl ThreadPool { impl ThreadPool {
/// Create a new ThreadPool
///
/// # Panics
///
/// The `new` function panics if the size is zero
pub fn new(size: usize) -> ThreadPool { pub fn new(size: usize) -> ThreadPool {
assert!(size > 0);
Self{} Self{}
} }
} }
fn main() -> std::io::Result<()> { fn main() -> std::io::Result<()> {