File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -24,17 +24,17 @@ impl SQLiteStore {
2424
2525impl Store for SQLiteStore {
2626 fn all ( & self ) -> Result < Vec < ( String , super :: StoreValue ) > > {
27- let mut stmt = self . connection . prepare ( "SELECT key,value from KV" ) ?;
27+ let mut query = self . connection . prepare ( "SELECT key,value from KV" ) ?;
2828
29- let values = stmt
29+ let values = query
3030 . query_map ( [ ] , |row| Ok ( ( row. get ( 0 ) ?, StoreValue :: Value ( row. get ( 1 ) ?) ) ) ) ?
3131 . collect :: < Result < Vec < _ > , _ > > ( ) ?;
3232
3333 Ok ( values)
3434 }
3535
3636 fn get ( & self , key : & str ) -> Result < Option < super :: StoreValue > > {
37- let stmt = self
37+ let query = self
3838 . connection
3939 . query_row (
4040 "SELECT key,value from KV where key = ?1 LIMIT 1" ,
@@ -43,7 +43,7 @@ impl Store for SQLiteStore {
4343 )
4444 . optional ( ) ?;
4545
46- Ok ( stmt )
46+ Ok ( query )
4747 }
4848
4949 fn set ( & mut self , key : & str , value : StoreValue ) -> Result < StoreValue > {
@@ -69,11 +69,11 @@ impl Store for SQLiteStore {
6969 return Ok ( None ) ;
7070 } ;
7171
72- let stmt = self
72+ let query = self
7373 . connection
7474 . execute ( "DELETE FROM KV where key = ?1" , [ key] ) ?;
7575
76- if stmt == 0 {
76+ if query == 0 {
7777 panic ! ( "Deleted 0 Rows when trying to delete Value from Store" )
7878 }
7979
You can’t perform that action at this time.
0 commit comments