Skip to content

Commit 938e4bd

Browse files
committed
refactor: rename query variables
1 parent 58892f9 commit 938e4bd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/storage/sqlite/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ impl SQLiteStore {
2424

2525
impl 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

0 commit comments

Comments
 (0)