diff --git a/src/unix.rs b/src/unix.rs index c85a24a..207e3d1 100644 --- a/src/unix.rs +++ b/src/unix.rs @@ -22,7 +22,9 @@ pub struct Acquired { impl Client { pub fn new(mut limit: usize) -> io::Result { - assert!(limit <= 4096, "Can't have limit larger than 4096 since the pipe would block forever when writing to it"); + if limit > 4096 { + return Err(io::Error::new(io::ErrorKind::Other, "Can't have limit larger than 4096 since the pipe would block forever when writing to it")); + } let client = unsafe { Client::mk()? };