Skip to content

Commit f8a5bd3

Browse files
committed
Update for closure changes
1 parent dbd23f9 commit f8a5bd3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/pool.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! A simple connection pool
22
3+
use std::cell::RefCell;
34
use sync::MutexArc;
45

56
use {PostgresNotifications,
@@ -109,8 +110,9 @@ pub struct PooledPostgresConnection {
109110
impl Drop for PooledPostgresConnection {
110111
fn drop(&mut self) {
111112
unsafe {
113+
let conn = RefCell::new(self.conn.take());
112114
self.pool.pool.unsafe_access(|pool| {
113-
pool.pool.push(self.conn.take_unwrap());
115+
pool.pool.push(conn.with_mut(|r| r.take_unwrap()));
114116
})
115117
}
116118
}

0 commit comments

Comments
 (0)