From 595da3e0a386455edeee71aa5b1258c9f681414e Mon Sep 17 00:00:00 2001 From: Stefan Ruzitschka <362487+icepuma@users.noreply.github.com> Date: Tue, 31 May 2022 15:28:48 +0200 Subject: [PATCH] [fix] pid is optional --- src/commands/time_entries.rs | 2 +- src/model.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/time_entries.rs b/src/commands/time_entries.rs index 44e7c49..e0bfa41 100644 --- a/src/commands/time_entries.rs +++ b/src/commands/time_entries.rs @@ -116,7 +116,7 @@ fn collect_output_entries( for entry in values { let maybe_workspace = workspace_lookup.get(&entry.wid); - let maybe_project = project_lookup.get(&entry.pid); + let maybe_project = &entry.pid.and_then(|pid| project_lookup.get(&pid)); let maybe_client = maybe_project .and_then(|project| project.cid.and_then(|c| client_lookup.get(&c))); diff --git a/src/model.rs b/src/model.rs index 51d2519..f7e722b 100644 --- a/src/model.rs +++ b/src/model.rs @@ -93,7 +93,7 @@ pub struct DataWith { pub struct TimeEntry { pub id: u64, pub wid: u64, - pub pid: u64, + pub pid: Option, pub billable: bool, pub start: DateTime, pub stop: Option>,