We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5c00370 + d13b68f commit 4eb2f25Copy full SHA for 4eb2f25
1 file changed
src/pool.rs
@@ -235,10 +235,18 @@ impl Pool {
235
/// After this method returns, all calls to `self::conn_blocking()` or
236
/// `self::conn_mut_blocking()` will return an [`Error::Closed`] error.
237
pub fn close_blocking(&self) -> Result<(), Error> {
238
- self.state
239
- .clients
240
- .iter()
241
- .try_for_each(|client| client.close_blocking())
+ let mut first_err = None;
+ for client in self.state.clients.iter() {
+ if let Err(e) = client.close_blocking() {
+ if first_err.is_none() {
242
+ first_err = Some(e);
243
+ }
244
245
246
+ match first_err {
247
+ Some(e) => Err(e),
248
+ None => Ok(()),
249
250
}
251
252
fn get(&self) -> &Client {
0 commit comments