diff options
| author | Federico Igne <git@federicoigne.com> | 2020-12-26 17:48:38 +0000 |
|---|---|---|
| committer | Federico Igne <git@federicoigne.com> | 2021-11-03 18:55:08 +0000 |
| commit | 02481656966b0a8dfc95cf3c22bcc049660ff7d4 (patch) | |
| tree | 8e39798fcaf27931d91c2088423fd4e97adcfc2d /rust/gigasecond/src/lib.rs | |
| parent | 4e2052c4d792540c2f742b2c2a081b11117ed41d (diff) | |
| download | exercism-02481656966b0a8dfc95cf3c22bcc049660ff7d4.tar.gz exercism-02481656966b0a8dfc95cf3c22bcc049660ff7d4.zip | |
Move Rust exercises in a subdirectory
Diffstat (limited to 'rust/gigasecond/src/lib.rs')
| -rw-r--r-- | rust/gigasecond/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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 @@ | |||
| 1 | use chrono::{DateTime, Duration, Utc}; | ||
| 2 | |||
| 3 | // Returns a Utc DateTime one billion seconds after start. | ||
| 4 | pub fn after(start: DateTime<Utc>) -> DateTime<Utc> { | ||
| 5 | let gigasecond = Duration::seconds(1_000_000_000); | ||
| 6 | start + gigasecond | ||
| 7 | } | ||
