mirror of
https://github.com/Xevion/exercism.git
synced 2025-12-17 08:11:51 -06:00
Begin Rust track : hello-world, gigasecond
This commit is contained in:
10
rust/gigasecond/src/lib.rs
Normal file
10
rust/gigasecond/src/lib.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use std::time::SystemTime;
|
||||
|
||||
use time::PrimitiveDateTime as DateTime;
|
||||
|
||||
const GIGASECOND_IN_SECONDS: i64 = 1_000_000_000;
|
||||
|
||||
// Returns a DateTime one billion seconds after start.
|
||||
pub fn after(start: DateTime) -> DateTime {
|
||||
start + time::Duration::seconds(GIGASECOND_IN_SECONDS)
|
||||
}
|
||||
Reference in New Issue
Block a user