Breathe life back into this project. #1

Merged
gburd merged 22 commits from gburd/2018edition-fmt-fix-deps into master 2020-01-16 16:27:21 +00:00
Showing only changes of commit 4e9d6b3f58 - Show all commits

View file

@ -143,17 +143,17 @@ impl SyncMetadata {
} }
pub fn is_tx_empty(db_tx: &rusqlite::Transaction, tx_id: Entid) -> Result<bool> { pub fn is_tx_empty(db_tx: &rusqlite::Transaction, tx_id: Entid) -> Result<bool> {
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<i64> { 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(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<bool> { pub fn has_entity_assertions_in_tx(db_tx: &rusqlite::Transaction, e: Entid, tx_id: Entid) -> Result<bool> {
let count = db_tx.query_row("SELECT count(rowid) FROM timelined_transactions WHERE timeline = 0 AND tx = ? AND e = ?", &[&tx_id, &e], |row| -> Result<i64> { 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(row.get(0)?)
})?; })?;
Ok(count? > 0) Ok(count > 0)
} }
} }