Going through rustlings for the first time
at main 565 B view raw
1// You can use the `use` keyword to bring module paths from modules from 2// anywhere and especially from the standard library into your scope. 3 4// TODO: Bring `SystemTime` and `UNIX_EPOCH` from the `std::time` module into 5// your scope. Bonus style points if you can do it with one line! 6// use ???; 7use std::time::{SystemTime, UNIX_EPOCH}; 8 9fn main() { 10 match SystemTime::now().duration_since(UNIX_EPOCH) { 11 Ok(n) => println!("1970-01-01 00:00:00 UTC was {} seconds ago!", n.as_secs()), 12 Err(_) => panic!("SystemTime before UNIX EPOCH!"), 13 } 14}