From 09e1c57f3275a02100adee90f7b576c810cd07e9 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Wed, 13 Dec 2023 13:22:12 -0700 Subject: [PATCH] when building day's log, skip stubs --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 32c2e4f..2e2c593 100644 --- a/src/main.rs +++ b/src/main.rs @@ -96,8 +96,13 @@ fn log(f: &String, enabled: &bool, since: &Option) -> Result<(), String> 0 => 1.0, _ => ((tsheet.xs[i].t - tsheet.xs[i-1].t) as f32 / (60.0*60.0)) as f32, }; - curr.t = x.timestamp(); - curr.xs.push(LogX{d: d, x: x.x.clone()}); + match x.x.len() { + 0 => {}, + _ => { + curr.t = x.timestamp(); + curr.xs.push(LogX{d: d, x: x.x.clone()}); + }, + }; } if curr.xs.len() > 0 { result.push(curr.clone());