Skip to content

Commit

Permalink
Add assert! to unix::Client::new
Browse files Browse the repository at this point in the history
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
  • Loading branch information
NobodyXu committed Jun 29, 2022
1 parent 8abfc60 commit c691145
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ pub struct Acquired {

impl Client {
pub fn new(mut limit: usize) -> io::Result<Client> {
assert!(limit <= 4096, "Can't have limit larger than 4096 since the pipe would block forever when writing to it");

let client = unsafe { Client::mk()? };

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

0 comments on commit c691145

Please sign in to comment.