wire types: WireTime newtype for timestamps instead of adaptor-annotated i64

This commit is contained in:
damocles 2026-07-03 19:18:33 +02:00 committed by mara
commit 1e205289c5
12 changed files with 148 additions and 162 deletions

View file

@ -231,9 +231,9 @@ impl Approvals {
agent: row.agent,
kind: kind_from_str(&row.kind)?,
commit_ref: row.commit_ref,
requested_at: row.requested_at,
requested_at: hive_sh4re::wire_time::WireTime(row.requested_at),
status: ApprovalStatus::Approved,
resolved_at: Some(resolved_at),
resolved_at: Some(hive_sh4re::wire_time::WireTime(resolved_at)),
note: None,
fetched_sha: row.fetched_sha,
description: row.description,
@ -294,9 +294,9 @@ impl Approvals {
agent: row.agent,
kind: kind_from_str(&row.kind)?,
commit_ref: row.commit_ref,
requested_at: row.requested_at,
requested_at: hive_sh4re::wire_time::WireTime(row.requested_at),
status: ApprovalStatus::Cancelled,
resolved_at: Some(resolved_at),
resolved_at: Some(hive_sh4re::wire_time::WireTime(resolved_at)),
note: Some(note),
fetched_sha: row.fetched_sha,
description: row.description,
@ -404,9 +404,11 @@ fn row_to_approval(row: &rusqlite::Row<'_>) -> rusqlite::Result<Approval> {
agent: row.get(1)?,
kind,
commit_ref: row.get(3)?,
requested_at: row.get(4)?,
requested_at: hive_sh4re::wire_time::WireTime(row.get(4)?),
status,
resolved_at: row.get(6)?,
resolved_at: row
.get::<_, Option<i64>>(6)?
.map(hive_sh4re::wire_time::WireTime),
note: row.get(7)?,
fetched_sha: row.get(8)?,
description: row.get(9)?,