summaryrefslogtreecommitdiffstats
path: root/src/db/invariants.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/invariants.rs')
-rw-r--r--src/db/invariants.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/db/invariants.rs b/src/db/invariants.rs
index e9e133f..964b03c 100644
--- a/src/db/invariants.rs
+++ b/src/db/invariants.rs
@@ -1,5 +1,4 @@
-
-use crate::db::*;
+use crate::db::Db;
use crate::error::Result;
// ------------------------------------------------------- invariant helpers --
@@ -29,7 +28,6 @@ pub fn unapproved_index_entries(db: &Db) -> Result<Vec<String>> {
})
}
-
#[derive(Debug, Clone)]
// Unbuilt stays `pub`: the attention row `approved_but_unbuilt` returns to the web UI and to tests/crash.rs.
pub struct Unbuilt {
@@ -76,21 +74,14 @@ pub fn approved_but_unbuilt(db: &Db) -> Result<Vec<Unbuilt>> {
let mut out = Vec::new();
for r in rows {
let (pkgbase, ae, av, ar, se, sv, sr, error, build_id) = r?;
- let (pkgbase, av, ar) = match (pkgbase, av, ar) {
- (Some(p), Some(v), Some(rel)) => (p, v, rel),
- _ => {
- return Err(crate::error::Error::Db(
- "failed build row without a candidate version".into(),
- ))
- }
+ let (Some(pkgbase), Some(av), Some(ar)) = (pkgbase, av, ar) else {
+ return Err(crate::error::Error::Db("failed build row without a candidate version".into()));
};
out.push(Unbuilt {
pkgbase,
approved: crate::pkgver::full_version(&ae.unwrap_or_default(), &av, &ar),
serving: match (sv, sr) {
- (Some(v), Some(rel)) => {
- crate::pkgver::full_version(&se.unwrap_or_default(), &v, &rel)
- }
+ (Some(v), Some(rel)) => crate::pkgver::full_version(&se.unwrap_or_default(), &v, &rel),
_ => String::new(),
},
error,