File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ impl Drop for Connection {
146146}
147147
148148impl Connection {
149- fn get_cache ( & self ) -> & RefCell < LruCache < String , Rc < PostgresStatement < ' static > > > > {
149+ fn get_cache < ' a > ( & ' a self ) -> & ' a RefCell < LruCache < String , Rc < PostgresStatement < ' a > > > > {
150150 unsafe { mem:: transmute ( self . stmts ) }
151151 }
152152}
@@ -157,11 +157,11 @@ impl GenericConnection for Connection {
157157 let mut stmts = self . get_cache ( ) . borrow_mut ( ) ;
158158
159159 if let Some ( stmt) = stmts. get ( & query) {
160- return Ok ( unsafe { mem :: transmute ( stmt. clone ( ) ) } ) ;
160+ return Ok ( stmt. clone ( ) ) ;
161161 }
162162
163163 let stmt = Rc :: new ( try!( self . conn . prepare ( query[ ] ) ) ) ;
164- stmts. put ( query, unsafe { mem :: transmute ( stmt. clone ( ) ) } ) ;
164+ stmts. put ( query, stmt. clone ( ) ) ;
165165 Ok ( stmt)
166166 }
167167
You can’t perform that action at this time.
0 commit comments