用 use 进行导入嵌套

Minimum Rust version: 1.25

在 Rust 中: 嵌套导入中添加了一种编写 use 语句的新方法。 如果您曾编写过这样的一组导入:

1. use std::fs::File;
2. use std::io::Read;
3. use std::path::{Path, PathBuf};

可以这样写了:

1. # mod foo {
2. // on one line
3. use std::{fs::File, io::Read, path::{Path, PathBuf}};
4. # }

6. # mod bar {
7. // with some more breathing room
8. use std::{
9. fs::File,
10. io::Read,
11. path::{
12. Path,
13. PathBuf
14. }
15. };
16. # }

这可以减少一些重复,并使事情更清晰。