fix weird params mis-matches with the params macro

This commit is contained in:
Conrad Dean 2019-07-22 22:20:14 -04:00
parent 4e9d6b3f58
commit 3547cfcd16
3 changed files with 4 additions and 4 deletions

View file

@ -76,7 +76,7 @@ impl SyncMetadata {
pub fn set_remote_head(tx: &rusqlite::Transaction, uuid: &Uuid) -> Result<()> {
let uuid_bytes = uuid.as_bytes().to_vec();
let updated = tx.execute("UPDATE tolstoy_metadata SET value = ? WHERE key = ?",
&[&uuid_bytes, &schema::REMOTE_HEAD_KEY])?;
rusqlite::params![&uuid_bytes, &schema::REMOTE_HEAD_KEY])?;
if updated != 1 {
bail!(TolstoyError::DuplicateMetadata(schema::REMOTE_HEAD_KEY.into()));
}

View file

@ -42,7 +42,7 @@ pub fn ensure_current_version(tx: &mut rusqlite::Transaction) -> Result<()> {
// Initial partition information is what we'd see at bootstrap, and is used during first sync.
for (name, start, end, index, allow_excision) in BOOTSTRAP_PARTITIONS.iter() {
tx.execute("INSERT OR IGNORE INTO tolstoy_parts VALUES (?, ?, ?, ?, ?)", &[&name.to_string(), start, end, index, allow_excision])?;
tx.execute("INSERT OR IGNORE INTO tolstoy_parts VALUES (?, ?, ?, ?, ?)", rusqlite::params![&name.to_string(), start, end, index, allow_excision])?;
}
tx.execute("INSERT OR IGNORE INTO tolstoy_metadata (key, value) VALUES (?, zeroblob(16))", &[&REMOTE_HEAD_KEY])?;

View file

@ -37,7 +37,7 @@ impl TxMapper {
)?;
for mapping in mappings.iter() {
let uuid_bytes = mapping.remote.as_bytes().to_vec();
stmt.execute(&[&mapping.local, &uuid_bytes])?;
stmt.execute(rusqlite::params![&mapping.local, &uuid_bytes])?;
}
Ok(())
}
@ -53,7 +53,7 @@ impl TxMapper {
None => {
let uuid = Uuid::new_v4();
let uuid_bytes = uuid.as_bytes().to_vec();
db_tx.execute("INSERT INTO tolstoy_tu (tx, uuid) VALUES (?, ?)", &[&tx, &uuid_bytes])?;
db_tx.execute("INSERT INTO tolstoy_tu (tx, uuid) VALUES (?, ?)", rusqlite::params![&tx, &uuid_bytes])?;
return Ok(uuid);
}
}