From 73296ede1fc7b1abde65546a71aef5a988c21e8d Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sun, 15 Nov 2026 22:30:48 -0700 Subject: multi-threaded. more dependencies :( the clock runs now! some unfortunate reliance on exact sequencing, which needs to be cleaned up Force-Push: yes Change-Id: I833dd0dd5047e3c2f04203e80e3fd722e36bf252 --- src/modules/time.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/modules/time.rs') diff --git a/src/modules/time.rs b/src/modules/time.rs index 8f6f417..f8ef95c 100644 --- a/src/modules/time.rs +++ b/src/modules/time.rs @@ -1,3 +1,4 @@ +use std::sync::{ Arc, Mutex }; use std::time::Duration; use time::OffsetDateTime; @@ -10,14 +11,14 @@ pub struct TimeModule { impl TimeModule { - pub fn new() -> TimeModule { + pub fn new() -> Arc> { let format_string = "[weekday repr:short] [year]-[month]-[day] ".to_owned() + "[hour repr:24]:[minute]:[second]"; let time_format = parse_owned::<3>(&format_string).unwrap(); - TimeModule { time_format } + Arc::new(Mutex::new(TimeModule { time_format })) } pub fn format(&mut self) -> String { -- cgit 1.4.1