From 4e9d6b3f5828da1b07e89dadc029d142798ac322 Mon Sep 17 00:00:00 2001 From: Conrad Dean Date: Mon, 22 Jul 2019 09:10:49 -0400 Subject: [PATCH] help compiler with an annotation on the outside of an expression instead of halfway through the middle of an expression --- tolstoy/src/metadata.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) } }