Skip to content

Commit c691145

Browse files
committed
Add assert! to unix::Client::new
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
1 parent 8abfc60 commit c691145

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/unix.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ pub struct Acquired {
2222

2323
impl Client {
2424
pub fn new(mut limit: usize) -> io::Result<Client> {
25+
assert!(limit <= 4096, "Can't have limit larger than 4096 since the pipe would block forever when writing to it");
26+
2527
let client = unsafe { Client::mk()? };
2628

2729
// I don't think the character written here matters, but I could be

0 commit comments

Comments
 (0)