about summary refs log tree commit diff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/time.rs5
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 {