summaryrefslogtreecommitdiffstats
path: root/src/db/approvals.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/approvals.rs')
-rw-r--r--src/db/approvals.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/db/approvals.rs b/src/db/approvals.rs
index ececc32..0c4a117 100644
--- a/src/db/approvals.rs
+++ b/src/db/approvals.rs
@@ -33,7 +33,13 @@ pub fn record_in(tx: &mut Transaction<'_>, d: &Decision<'_>) -> Result<i64> {
Ok(tx.last_insert_rowid())
}
-pub fn record_rejection_in(tx: &mut Transaction<'_>, candidate_id: i64, at: &str, identity_hash: &str, note: &str) -> Result<()> {
+pub fn record_rejection_in(
+ tx: &mut Transaction<'_>,
+ candidate_id: i64,
+ at: &str,
+ identity_hash: &str,
+ note: &str,
+) -> Result<()> {
tx.execute(
"INSERT INTO approval (candidate_id, base_release_id, decided_at, decision, risk_level,
diff_digest, identity_hash, note)
@@ -46,11 +52,9 @@ pub fn record_rejection_in(tx: &mut Transaction<'_>, candidate_id: i64, at: &str
pub fn for_candidate(db: &Db, candidate_id: i64) -> Result<Option<(i64, String)>> {
db.read(|c| {
- Ok(c.query_row(
- "SELECT id, decision FROM approval WHERE candidate_id=?1",
- params![candidate_id],
- |r| Ok((r.get(0)?, r.get(1)?)),
- )
+ Ok(c.query_row("SELECT id, decision FROM approval WHERE candidate_id=?1", params![candidate_id], |r| {
+ Ok((r.get(0)?, r.get(1)?))
+ })
.optional()?)
})
}