Minor tidying

This commit is contained in:
dbr 2021-04-29 00:10:53 +10:00
parent 5ae828b1eb
commit cf70ef49ed

View file

@ -100,7 +100,7 @@ impl<'t> StorageTxn for Txn<'t> {
let data = TaskMap::default(); let data = TaskMap::default();
let data_str = serde_json::to_string(&data)?; let data_str = serde_json::to_string(&data)?;
t.execute( t.execute(
"INSERT INTO TASKS (uuid, data) VALUES (?, ?)", "INSERT INTO tasks (uuid, data) VALUES (?, ?)",
params![&uuid, &data_str], params![&uuid, &data_str],
) )
.context("Create task query")?; .context("Create task query")?;
@ -214,11 +214,8 @@ impl<'t> StorageTxn for Txn<'t> {
fn set_operations(&mut self, ops: Vec<Operation>) -> anyhow::Result<()> { fn set_operations(&mut self, ops: Vec<Operation>) -> anyhow::Result<()> {
let t = self.get_txn()?; let t = self.get_txn()?;
t.execute( t.execute("DELETE FROM operations", [])
"DELETE FROM operations", .context("Clear all existing operations")?;
[],
)
.context("Clear all existing operations")?;
for o in ops { for o in ops {
self.add_operation(o)?; self.add_operation(o)?;