Update for closure changes
This commit is contained in:
parent
dbd23f9442
commit
f8a5bd3009
@ -1,5 +1,6 @@
|
|||||||
//! A simple connection pool
|
//! A simple connection pool
|
||||||
|
|
||||||
|
use std::cell::RefCell;
|
||||||
use sync::MutexArc;
|
use sync::MutexArc;
|
||||||
|
|
||||||
use {PostgresNotifications,
|
use {PostgresNotifications,
|
||||||
@ -109,8 +110,9 @@ pub struct PooledPostgresConnection {
|
|||||||
impl Drop for PooledPostgresConnection {
|
impl Drop for PooledPostgresConnection {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
let conn = RefCell::new(self.conn.take());
|
||||||
self.pool.pool.unsafe_access(|pool| {
|
self.pool.pool.unsafe_access(|pool| {
|
||||||
pool.pool.push(self.conn.take_unwrap());
|
pool.pool.push(conn.with_mut(|r| r.take_unwrap()));
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user