Skip to content

Commit 1bcca8a

Browse files
committed
fix crate-details view when there are no builds
1 parent 603aa5e commit 1bcca8a

7 files changed

Lines changed: 24 additions & 22 deletions

crates/bin/docs_rs_web/.sqlx/query-9399c68093aa75e16820173a658ecf08566aecfa06e6a2c4a146b54213498b77.json renamed to .sqlx/query-2c7c1c2f69ccea2fbb16d6d7706b41d9a17670801c85b53b235b306ec8eef95e.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-2df26f6575cb3b80255731a15229aebea927233c23192fd7f4b1639b746d38bf.json renamed to .sqlx/query-c187e208794078317762450f53054049157f3b7ee2b715173f5accf559df3cfc.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-9399c68093aa75e16820173a658ecf08566aecfa06e6a2c4a146b54213498b77.json renamed to crates/bin/cratesfyi/.sqlx/query-2c7c1c2f69ccea2fbb16d6d7706b41d9a17670801c85b53b235b306ec8eef95e.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bin/docs_rs_web/.sqlx/query-2df26f6575cb3b80255731a15229aebea927233c23192fd7f4b1639b746d38bf.json renamed to crates/bin/cratesfyi/.sqlx/query-c187e208794078317762450f53054049157f3b7ee2b715173f5accf559df3cfc.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bin/cratesfyi/.sqlx/query-9399c68093aa75e16820173a658ecf08566aecfa06e6a2c4a146b54213498b77.json renamed to crates/bin/docs_rs_web/.sqlx/query-2c7c1c2f69ccea2fbb16d6d7706b41d9a17670801c85b53b235b306ec8eef95e.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bin/cratesfyi/.sqlx/query-2df26f6575cb3b80255731a15229aebea927233c23192fd7f4b1639b746d38bf.json renamed to crates/bin/docs_rs_web/.sqlx/query-c187e208794078317762450f53054049157f3b7ee2b715173f5accf559df3cfc.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bin/docs_rs_web/src/handlers/crate_details.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ impl BuildStatistics {
363363
Ok(Self {
364364
avg_build_duration_release: sqlx::query_scalar!(
365365
r#"
366-
SELECT AVG(b.build_finished - b.build_started) AS "duration!: Duration"
366+
SELECT AVG(b.build_finished - b.build_started) AS "duration?: Duration"
367367
FROM builds AS b
368368
WHERE
369369
b.rid = $1 AND
@@ -372,11 +372,12 @@ impl BuildStatistics {
372372
release_id as _,
373373
)
374374
.fetch_optional(&mut *conn)
375-
.await?,
375+
.await?
376+
.flatten(),
376377
avg_build_duration_crate: sqlx::query_scalar!(
377378
r#"
378379
SELECT
379-
AVG(b.build_finished - b.build_started) AS "duration!: Duration"
380+
AVG(b.build_finished - b.build_started) AS "duration?: Duration"
380381
381382
FROM
382383
crates AS c
@@ -390,7 +391,8 @@ impl BuildStatistics {
390391
crate_id as _,
391392
)
392393
.fetch_optional(&mut *conn)
393-
.await?,
394+
.await?
395+
.flatten(),
394396
})
395397
}
396398
}

0 commit comments

Comments
 (0)