From f2da7ce4a9b27fa5ecfcde673a5d1b8a145509b5 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 28 May 2016 20:36:43 +0200 Subject: [PATCH] Implement Time --- libimagtimeui/src/time.rs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/libimagtimeui/src/time.rs b/libimagtimeui/src/time.rs index be12dfa0..2b727629 100644 --- a/libimagtimeui/src/time.rs +++ b/libimagtimeui/src/time.rs @@ -10,8 +10,24 @@ pub struct Time { impl Time { - fn new(hour: u32, minute: u32, second: u32) -> Time { - unimplemented!() + pub fn new(hour: u32, minute: u32, second: u32) -> Time { + Time { + hour: hour, + minute: minute, + second: second + } + } + + pub fn hour(&self) -> u32 { + self.hour + } + + pub fn minute(&self) -> u32 { + self.minute + } + + pub fn second(&self) -> u32 { + self.second } }