diff options
Diffstat (limited to 'src/review/candidates.rs')
| -rw-r--r-- | src/review/candidates.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/review/candidates.rs b/src/review/candidates.rs index 236f85b..f90b1ef 100644 --- a/src/review/candidates.rs +++ b/src/review/candidates.rs @@ -2,8 +2,8 @@ use crate::db::{self, candidates as sql, Db, Pkgbase, ReleaseRow}; use crate::error::Result; pub use crate::db::candidates::{ - all as all_candidates, by_id as candidate_by_id, mark_viewed, pending as pending_candidates, - set_diff_digest, NewCandidate, + all as all_candidates, by_id as candidate_by_id, mark_viewed, pending as pending_candidates, set_diff_digest, + NewCandidate, }; #[derive(Debug, Clone, PartialEq, Eq)] @@ -15,8 +15,14 @@ pub enum Upsert { Unchanged, } -pub(crate) fn upsert_candidate(db: &Db, pb: &Pkgbase, accepted: Option<&ReleaseRow>, nc: &NewCandidate) -> Result<Upsert> { - let kind = if accepted.is_some() { db::candidate_kind::NEW_VERSION } else { db::candidate_kind::FIRST_INTRODUCTION }; +pub(crate) fn upsert_candidate( + db: &Db, + pb: &Pkgbase, + accepted: Option<&ReleaseRow>, + nc: &NewCandidate, +) -> Result<Upsert> { + let kind = + if accepted.is_some() { db::candidate_kind::NEW_VERSION } else { db::candidate_kind::FIRST_INTRODUCTION }; let base = accepted.map(|a| a.id); let pkgbase_id = pb.id; let nc = nc.clone(); |
