From 02481656966b0a8dfc95cf3c22bcc049660ff7d4 Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Sat, 26 Dec 2020 17:48:38 +0000 Subject: Move Rust exercises in a subdirectory --- rust/gigasecond/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 rust/gigasecond/src/lib.rs (limited to 'rust/gigasecond/src/lib.rs') diff --git a/rust/gigasecond/src/lib.rs b/rust/gigasecond/src/lib.rs new file mode 100644 index 0000000..0abd90b --- /dev/null +++ b/rust/gigasecond/src/lib.rs @@ -0,0 +1,7 @@ +use chrono::{DateTime, Duration, Utc}; + +// Returns a Utc DateTime one billion seconds after start. +pub fn after(start: DateTime) -> DateTime { + let gigasecond = Duration::seconds(1_000_000_000); + start + gigasecond +} -- cgit v1.2.3