@@ -127,6 +127,7 @@ impl ThreadPoolBuilder {
127
127
/// # Panics
128
128
///
129
129
/// Panics if the value is zero.
130
+ #[ must_use]
130
131
pub fn capacity ( & mut self , capacity : usize ) -> & mut Self {
131
132
self . capacity = capacity;
132
133
self
@@ -137,6 +138,7 @@ impl ThreadPoolBuilder {
137
138
//
138
139
// If it is ready to be made public in the future, please don't forget to
139
140
// replace the `panic!` in the `build` function with a recoverable error.
141
+ #[ must_use]
140
142
#[ allow( dead_code) ]
141
143
fn threads ( & mut self , threads : usize ) -> & mut Self {
142
144
self . threads = threads;
@@ -146,6 +148,7 @@ impl ThreadPoolBuilder {
146
148
/// Provide a function that will be called on each thread of the thread pool
147
149
/// immediately after it is spawned. This can, for example, be used to set
148
150
/// core affinity for each thread.
151
+ #[ must_use]
149
152
pub fn on_thread_spawn < F > ( & mut self , f : F ) -> & mut Self
150
153
where
151
154
F : Fn ( ) + Send + Sync + ' static ,
@@ -156,6 +159,7 @@ impl ThreadPoolBuilder {
156
159
157
160
/// Provide a function that will be called on each thread of the thread pool
158
161
/// just before the thread finishes.
162
+ #[ must_use]
159
163
pub fn on_thread_finish < F > ( & mut self , f : F ) -> & mut Self
160
164
where
161
165
F : Fn ( ) + Send + Sync + ' static ,
0 commit comments