We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ThreadPoolBuilder::capacity
1 parent da28176 commit 5764291Copy full SHA for 5764291
spdlog/src/thread_pool.rs
@@ -124,9 +124,10 @@ impl ThreadPoolBuilder {
124
/// When a new operation is incoming, but the channel is full, it will be
125
/// handled by sink according to the [`OverflowPolicy`] that has been set.
126
///
127
- /// # Panics
+ /// # Errors
128
129
- /// Panics if the value is zero.
+ /// The `build()` will return [`Error::InvalidArgument`] if the value is
130
+ /// zero.
131
#[must_use]
132
pub fn capacity(&mut self, capacity: usize) -> &mut Self {
133
self.capacity = capacity;
@@ -241,7 +242,7 @@ mod tests {
241
242
use super::*;
243
244
#[test]
- fn panic_capacity_0() {
245
+ fn error_capacity_0() {
246
assert!(matches!(
247
ThreadPool::builder().capacity(0).build(),
248
Err(Error::InvalidArgument(
0 commit comments