diff --git a/tokio-sync/src/mpsc/bounded.rs b/tokio-sync/src/mpsc/bounded.rs index 9bbfe6770..2b832d58e 100644 --- a/tokio-sync/src/mpsc/bounded.rs +++ b/tokio-sync/src/mpsc/bounded.rs @@ -111,7 +111,7 @@ pub struct RecvError(()); /// })); /// ``` pub fn channel(buffer: usize) -> (Sender, Receiver) { - assert_eq!(buffer >= 1, true); + assert!(buffer > 0, "mpsc bounded channel requires buffer > 0"); let semaphore = (::semaphore::Semaphore::new(buffer), buffer); let (tx, rx) = chan::channel(semaphore);