6: Add solution to Rust track exercise "Gigasecond".
[?]
Aaw9nJhsNmfzFih9mKyNw9mV8CgERXJkRa1kK1Kx3LQH
Oct 10, 2021, 2:21 PM
KG7NGGS4TDAGDVHKJ4A5CHLRXQN2HBVZSDJNA7WIORMFRBX7YIRACDependencies
- [2]
JEYE3DLS5: Add Rust track exercise "Gigasecond".
Change contents
- replacement in rust/gigasecond/tests/gigasecond.rs at line 5
let start_date = Utc.ymd(2011, 4, 25).and_hms(0, 0, 0);let start_date = Utc.ymd(2011, 4, 25).and_hms(0, 0, 0); - replacement in rust/gigasecond/tests/gigasecond.rs at line 7
assert_eq!(gigasecond::after(start_date),Utc.ymd(2043, 1, 1).and_hms(1, 46, 40));assert_eq!(gigasecond::after(start_date),Utc.ymd(2043, 1, 1).and_hms(1, 46, 40)); - replacement in rust/gigasecond/tests/gigasecond.rs at line 16
let start_date = Utc.ymd(1977, 6, 13).and_hms(0, 0, 0);let start_date = Utc.ymd(1977, 6, 13).and_hms(0, 0, 0); - replacement in rust/gigasecond/tests/gigasecond.rs at line 18
assert_eq!(gigasecond::after(start_date),Utc.ymd(2009, 2, 19).and_hms(1, 46, 40));assert_eq!(gigasecond::after(start_date),Utc.ymd(2009, 2, 19).and_hms(1, 46, 40)); - replacement in rust/gigasecond/tests/gigasecond.rs at line 27
let start_date = Utc.ymd(1959, 7, 19).and_hms(0, 0, 0);let start_date = Utc.ymd(1959, 7, 19).and_hms(0, 0, 0); - replacement in rust/gigasecond/tests/gigasecond.rs at line 29
assert_eq!(gigasecond::after(start_date),Utc.ymd(1991, 3, 27).and_hms(1, 46, 40));assert_eq!(gigasecond::after(start_date),Utc.ymd(1991, 3, 27).and_hms(1, 46, 40)); - replacement in rust/gigasecond/tests/gigasecond.rs at line 38
let start_date = Utc.ymd(2015, 1, 24).and_hms(22, 0, 0);let start_date = Utc.ymd(2015, 1, 24).and_hms(22, 0, 0); - replacement in rust/gigasecond/tests/gigasecond.rs at line 40
assert_eq!(gigasecond::after(start_date),Utc.ymd(2046, 10, 2).and_hms(23, 46, 40));assert_eq!(gigasecond::after(start_date),Utc.ymd(2046, 10, 2).and_hms(23, 46, 40)); - replacement in rust/gigasecond/tests/gigasecond.rs at line 49
let start_date = Utc.ymd(2015, 1, 24).and_hms(23, 59, 59);let start_date = Utc.ymd(2015, 1, 24).and_hms(23, 59, 59); - replacement in rust/gigasecond/tests/gigasecond.rs at line 51
assert_eq!(gigasecond::after(start_date),Utc.ymd(2046, 10, 3).and_hms(1, 46, 39));assert_eq!(gigasecond::after(start_date),Utc.ymd(2046, 10, 3).and_hms(1, 46, 39)); - replacement in rust/gigasecond/src/lib.rs at line 1
use chrono::{DateTime, Utc};use chrono::{DateTime, Duration, Utc}; - replacement in rust/gigasecond/src/lib.rs at line 5
unimplemented!("What time is a gigasecond later than {}", start);start + Duration::seconds(10_i64.pow(9))