summaryrefslogtreecommitdiffstats
path: root/tokio-sync
diff options
context:
space:
mode:
authorSean McArthur <sean@seanmonstar.com>2019-02-19 16:18:38 -0800
committerSean McArthur <sean@seanmonstar.com>2019-02-19 17:09:36 -0800
commitd0cdcff8aa5c4a8cc2decd4071291084a8fb0a89 (patch)
treed00668a6244ceb595f9aeacafadcc29182f1444e /tokio-sync
parente3115231dd9388d1594b117a6890ec76b200965d (diff)
sync: improve assert message for bounded channel buffer size
Diffstat (limited to 'tokio-sync')
-rw-r--r--tokio-sync/src/mpsc/bounded.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/tokio-sync/src/mpsc/bounded.rs b/tokio-sync/src/mpsc/bounded.rs
index 9bbfe677..2b832d58 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<T>(buffer: usize) -> (Sender<T>, Receiver<T>) {
- 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);