diff --git a/tolstoy/src/metadata.rs b/tolstoy/src/metadata.rs index 9999f9de..8547cbfb 100644 --- a/tolstoy/src/metadata.rs +++ b/tolstoy/src/metadata.rs @@ -143,17 +143,17 @@ impl SyncMetadata { } pub fn is_tx_empty(db_tx: &rusqlite::Transaction, tx_id: Entid) -> Result { - let count = db_tx.query_row("SELECT count(rowid) FROM timelined_transactions WHERE timeline = 0 AND tx = ? AND e != ?", &[&tx_id, &tx_id], |row| -> Result { + let count: i64 = db_tx.query_row("SELECT count(rowid) FROM timelined_transactions WHERE timeline = 0 AND tx = ? AND e != ?", &[&tx_id, &tx_id], |row| { Ok(row.get(0)?) })?; - Ok(count? == 0) + Ok(count == 0) } pub fn has_entity_assertions_in_tx(db_tx: &rusqlite::Transaction, e: Entid, tx_id: Entid) -> Result { - let count = db_tx.query_row("SELECT count(rowid) FROM timelined_transactions WHERE timeline = 0 AND tx = ? AND e = ?", &[&tx_id, &e], |row| -> Result { + let count: i64 = db_tx.query_row("SELECT count(rowid) FROM timelined_transactions WHERE timeline = 0 AND tx = ? AND e = ?", &[&tx_id, &e], |row| { Ok(row.get(0)?) })?; - Ok(count? > 0) + Ok(count > 0) } }