Skip to content

Commit 5764291

Browse files
committed
Fix outdated doc for ThreadPoolBuilder::capacity
1 parent da28176 commit 5764291

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spdlog/src/thread_pool.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ impl ThreadPoolBuilder {
124124
/// When a new operation is incoming, but the channel is full, it will be
125125
/// handled by sink according to the [`OverflowPolicy`] that has been set.
126126
///
127-
/// # Panics
127+
/// # Errors
128128
///
129-
/// Panics if the value is zero.
129+
/// The `build()` will return [`Error::InvalidArgument`] if the value is
130+
/// zero.
130131
#[must_use]
131132
pub fn capacity(&mut self, capacity: usize) -> &mut Self {
132133
self.capacity = capacity;
@@ -241,7 +242,7 @@ mod tests {
241242
use super::*;
242243

243244
#[test]
244-
fn panic_capacity_0() {
245+
fn error_capacity_0() {
245246
assert!(matches!(
246247
ThreadPool::builder().capacity(0).build(),
247248
Err(Error::InvalidArgument(

0 commit comments

Comments
 (0)