6: Add solution to Rust track exercise "Gigasecond".
[?]
9Zb2bmkejrNknawUtr3MKvVstZkVDR8x8ritfgZXKrky
Dec 23, 2021, 5:17 PM
24GGBHIIHWNRB6TYMGSKKB4MEMU2GDZDMYPFPK5NME7TGRSLVLAACDependencies
- [2]
FEICPMFG5: Add Rust track exercise "Gigasecond".
Change contents
- replacement in rust/gigasecond/tests/gigasecond.rs at line 7
use time::{Date, Time};use time::{Date, Time}; - replacement in rust/gigasecond/tests/gigasecond.rs at line 9
DateTime::new(Date::from_calendar_date(year, month.try_into().unwrap(), day).unwrap(),Time::from_hms(hour, minute, second).unwrap(),)DateTime::new(Date::from_calendar_date(year, month.try_into().unwrap(), day).unwrap(),Time::from_hms(hour, minute, second).unwrap(),) - replacement in rust/gigasecond/tests/gigasecond.rs at line 17
let start_date = dt(2011, 4, 25, 0, 0, 0);let start_date = dt(2011, 4, 25, 0, 0, 0); - replacement in rust/gigasecond/tests/gigasecond.rs at line 19
assert_eq!(gigasecond::after(start_date), dt(2043, 1, 1, 1, 46, 40));assert_eq!(gigasecond::after(start_date), dt(2043, 1, 1, 1, 46, 40)); - replacement in rust/gigasecond/tests/gigasecond.rs at line 25
let start_date = dt(1977, 6, 13, 0, 0, 0);let start_date = dt(1977, 6, 13, 0, 0, 0); - replacement in rust/gigasecond/tests/gigasecond.rs at line 27
assert_eq!(gigasecond::after(start_date), dt(2009, 2, 19, 1, 46, 40));assert_eq!(gigasecond::after(start_date), dt(2009, 2, 19, 1, 46, 40)); - replacement in rust/gigasecond/tests/gigasecond.rs at line 33
let start_date = dt(1959, 7, 19, 0, 0, 0);let start_date = dt(1959, 7, 19, 0, 0, 0); - replacement in rust/gigasecond/tests/gigasecond.rs at line 35
assert_eq!(gigasecond::after(start_date), dt(1991, 3, 27, 1, 46, 40));assert_eq!(gigasecond::after(start_date), dt(1991, 3, 27, 1, 46, 40)); - replacement in rust/gigasecond/tests/gigasecond.rs at line 41
let start_date = dt(2015, 1, 24, 22, 0, 0);let start_date = dt(2015, 1, 24, 22, 0, 0); - replacement in rust/gigasecond/tests/gigasecond.rs at line 43
assert_eq!(gigasecond::after(start_date), dt(2046, 10, 2, 23, 46, 40));assert_eq!(gigasecond::after(start_date), dt(2046, 10, 2, 23, 46, 40)); - replacement in rust/gigasecond/tests/gigasecond.rs at line 49
let start_date = dt(2015, 1, 24, 23, 59, 59);let start_date = dt(2015, 1, 24, 23, 59, 59); - replacement in rust/gigasecond/tests/gigasecond.rs at line 51
assert_eq!(gigasecond::after(start_date), dt(2046, 10, 3, 1, 46, 39));assert_eq!(gigasecond::after(start_date), dt(2046, 10, 3, 1, 46, 39)); - replacement in rust/gigasecond/src/lib.rs at line 1
use time::PrimitiveDateTime as DateTime;use time::{Duration, PrimitiveDateTime as DateTime}; - 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))