You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
612 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// modules3.rs
// 你可以使用 'use' 关键字将任何位置的模块(特别是 Rust 标准库中的模块)引入作用域。
// 从 std::time 模块引入 SystemTime 和 UNIX_EPOCH。如果你能用一行代码解决就能获得额外得分。
// 让我能够编译!执行 `rustex hint modules3` 获取提示 :)
// I AM NOT DONE
// TODO: 完成这个 `use` 语句
use ???
fn main() {
match SystemTime::now().duration_since(UNIX_EPOCH) {
Ok(n) => println!("1970-01-01 00:00:00 UTC was {} seconds ago!", n.as_secs()),
Err(_) => panic!("SystemTime before UNIX EPOCH!"),
}
}