File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -124,9 +124,10 @@ impl ThreadPoolBuilder {
124
124
/// When a new operation is incoming, but the channel is full, it will be
125
125
/// handled by sink according to the [`OverflowPolicy`] that has been set.
126
126
///
127
- /// # Panics
127
+ /// # Errors
128
128
///
129
- /// Panics if the value is zero.
129
+ /// The `build()` will return [`Error::InvalidArgument`] if the value is
130
+ /// zero.
130
131
#[ must_use]
131
132
pub fn capacity ( & mut self , capacity : usize ) -> & mut Self {
132
133
self . capacity = capacity;
@@ -241,7 +242,7 @@ mod tests {
241
242
use super :: * ;
242
243
243
244
#[ test]
244
- fn panic_capacity_0 ( ) {
245
+ fn error_capacity_0 ( ) {
245
246
assert ! ( matches!(
246
247
ThreadPool :: builder( ) . capacity( 0 ) . build( ) ,
247
248
Err ( Error :: InvalidArgument (
You can’t perform that action at this time.
0 commit comments