diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-11-15 22:30:48 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-11-15 22:30:48 -0700 |
| commit | 73296ede1fc7b1abde65546a71aef5a988c21e8d (patch) | |
| tree | f19bdf87f74663f207975353b3b90420084fc2fa /src/modules | |
| parent | 5b488f558ccaca6ac35edda0366d74b9126285e3 (diff) | |
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
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/time.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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<Mutex<TimeModule>> { 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 { |