refactor: ApprovalKind::as_str owns the kind→string mapping
replaces three hand-rolled six-arm matches (actions.rs ×2, state_snapshot.rs); approvals::kind_to_str delegates. a new kind can no longer silently miss one of them
This commit is contained in:
parent
084e12503c
commit
f74c1984d7
4 changed files with 25 additions and 35 deletions
|
|
@ -526,14 +526,7 @@ fn history_view(a: Approval) -> ApprovalHistoryView {
|
|||
// Pending shouldn't appear in recent_resolved, but be defensive.
|
||||
hive_sh4re::ApprovalStatus::Pending => "pending",
|
||||
};
|
||||
let kind = match a.kind {
|
||||
hive_sh4re::ApprovalKind::ApplyCommit => "apply_commit",
|
||||
hive_sh4re::ApprovalKind::Spawn => "spawn",
|
||||
hive_sh4re::ApprovalKind::InitConfig => "init_config",
|
||||
hive_sh4re::ApprovalKind::UpdateMetaInputs => "update_meta_inputs",
|
||||
hive_sh4re::ApprovalKind::SchedulePrompt => "schedule_prompt",
|
||||
hive_sh4re::ApprovalKind::MergeConfigPr => "merge_config_pr",
|
||||
};
|
||||
let kind = a.kind.as_str();
|
||||
ApprovalHistoryView {
|
||||
id: a.id,
|
||||
agent: a.agent,
|
||||
|
|
|
|||
Loading…
Reference in a new issue