File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -568,7 +568,7 @@ impl<'a> Database<'a> {
568568 env:: env_ptr( env) , ptr:: null_mut( ) , 0 , & mut raw_tx) ) ;
569569 let mut wrapped_tx = TxHandle ( raw_tx) ; // For auto-closing etc
570570 lmdb_call ! ( ffi:: mdb_dbi_open(
571- raw_tx, name_cstr. map_or( ptr:: null( ) , |s| s. as_ptr( ) ) ,
571+ raw_tx, name_cstr. as_ref ( ) . map_or( ptr:: null( ) , |s| s. as_ptr( ) ) ,
572572 options. flags. bits( ) , & mut raw) ) ;
573573
574574 if !locked_dbis. insert ( raw) {
Original file line number Diff line number Diff line change @@ -259,8 +259,8 @@ impl Drop for TxHandle {
259259
260260impl TxHandle {
261261 pub unsafe fn commit ( & mut self ) -> Result < ( ) > {
262- lmdb_call ! ( ffi :: mdb_txn_commit ( self . 0 ) ) ;
263- self . 0 = ptr :: null_mut ( ) ;
262+ let txn_p = mem :: replace ( & mut self . 0 , ptr :: null_mut ( ) ) ;
263+ lmdb_call ! ( ffi :: mdb_txn_commit ( txn_p ) ) ;
264264 Ok ( ( ) )
265265 }
266266}
You can’t perform that action at this time.
0 commit comments