diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2016-12-17 15:50:27 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2016-12-17 16:00:19 +0100 |
commit | 8ceac0236c555979a9172c69c1a9e895d7487d6f (patch) | |
tree | 390740422d514ac62bc572d61c64e7375f2d7a27 /rust/src/message.rs | |
parent | f355162fde31a4c79b7e665b43cef2de3ba05cb5 (diff) | |
download | auth-xmppmessage-8ceac0236c555979a9172c69c1a9e895d7487d6f.tar.gz auth-xmppmessage-8ceac0236c555979a9172c69c1a9e895d7487d6f.zip |
replace all with subdirectory rust/
Diffstat (limited to 'rust/src/message.rs')
-rw-r--r-- | rust/src/message.rs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/rust/src/message.rs b/rust/src/message.rs deleted file mode 100644 index 0af1a13..0000000 --- a/rust/src/message.rs +++ /dev/null @@ -1,22 +0,0 @@ -///! Formats the message to be sent to the user -use time::{at_utc, Timespec, strftime}; - - -pub fn format_message(token: String, valid_from: i64, valid_until: i64) -> String { - return format!("Token: {}. Valid from {} until {}", - token, - strftime("%F %X", &at_utc(Timespec::new(valid_from, 0))).unwrap(), - strftime("%F %X", &at_utc(Timespec::new(valid_until, 0))).unwrap()); -} - - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test1() { - assert_eq!(format_message("7A-74-F4".to_string(), 0, 1481831953), - "Token: 7A-74-F4. Valid from 1970-01-01 00:00:00 until 2016-12-15 19:59:13"); - } -}
\ No newline at end of file |