Remove format_duration_exact, rename ref_short to branch_short
format_duration_exact was just format_duration(Some, Some) — callers
now use the optional form directly. ref_short only strips refs/heads/,
not refs/tags/, so renamed to branch_short to be honest about the
scope.
Assisted-by: GLM-5.1 via pi
diff --git a/src/quire/web/format.rs b/src/quire/web/format.rs
index f621127..920260f 100644
--- a/src/quire/web/format.rs
+++ b/src/quire/web/format.rs
@@ -55,11 +55,6 @@ pub fn format_duration(start: Option<i64>, end: Option<i64>) -> String {
}
}
-/// Duration between exact start/end millisecond timestamps.
-pub fn format_duration_exact(start: i64, end: i64) -> String {
- format_ms_duration(end - start)
-}
-
fn format_ms_duration(ms: i64) -> String {
let total_secs = (ms.max(0)) / 1000;
if total_secs == 0 {
diff --git a/src/quire/web/templates.rs b/src/quire/web/templates.rs
index fc77141..0fa797c 100644
--- a/src/quire/web/templates.rs
+++ b/src/quire/web/templates.rs
@@ -68,7 +68,7 @@ impl RunListRow {
&self.sha[..self.sha.len().min(8)]
}
- pub fn ref_short(&self) -> &str {
+ pub fn branch_short(&self) -> &str {
self.ref_name.trim_start_matches("refs/heads/")
}
@@ -120,7 +120,7 @@ impl DetailRun {
&self.sha[..self.sha.len().min(8)]
}
- pub fn ref_short(&self) -> &str {
+ pub fn branch_short(&self) -> &str {
self.ref_name.trim_start_matches("refs/heads/")
}
@@ -202,7 +202,7 @@ pub struct DetailShEvent {
impl DetailShEvent {
pub fn duration_display(&self) -> String {
- format::format_duration_exact(self.started_at_ms, self.finished_at_ms)
+ format::format_duration(Some(self.started_at_ms), Some(self.finished_at_ms))
}
pub fn cmd_display(&self) -> &str {
diff --git a/templates/ci/run_detail.html b/templates/ci/run_detail.html
index 2c84cfd..1e65b0a 100644
--- a/templates/ci/run_detail.html
+++ b/templates/ci/run_detail.html
@@ -10,7 +10,7 @@
<div class="ci-meta">
<div class="ci-meta-primary">
<span class="c-accent">{{ run.sha_short() }}</span>
- · {{ run.ref_short() }}
+ · {{ run.branch_short() }}
· <span class="{{ run.state_class() }}">{{ run.state }}</span>
</div>
<div class="ci-meta-secondary">
diff --git a/templates/ci/run_list.html b/templates/ci/run_list.html
index 37bf0e7..2908486 100644
--- a/templates/ci/run_list.html
+++ b/templates/ci/run_list.html
@@ -23,7 +23,7 @@
<tr>
<td><span class="ci-status-dot {{ run.state_class() }}"></span></td>
<td><a href="/{{ repo }}/ci/{{ run.id }}" class="ci-commit-link">{{ run.sha_short() }}</a></td>
- <td>{{ run.ref_short() }}</td>
+ <td>{{ run.branch_short() }}</td>
<td><time title="{{ run.queued_iso() }}">{{ run.queued_relative() }}</time></td>
<td>{{ run.duration_display() }}</td>
</tr>