1
1
use std:: collections:: BTreeSet ;
2
2
use std:: fs;
3
- use std:: path;
3
+ use std:: path:: { PathBuf , Path } ;
4
4
use crate :: features:: { collect_lang_features, collect_lib_features, Features , Status } ;
5
5
6
6
pub const PATH_STR : & str = "doc/unstable-book" ;
@@ -12,19 +12,19 @@ pub const LANG_FEATURES_DIR: &str = "src/language-features";
12
12
pub const LIB_FEATURES_DIR : & str = "src/library-features" ;
13
13
14
14
/// Builds the path to the Unstable Book source directory from the Rust 'src' directory.
15
- pub fn unstable_book_path ( base_src_path : & path :: Path ) -> path :: PathBuf {
15
+ pub fn unstable_book_path ( base_src_path : & Path ) -> PathBuf {
16
16
base_src_path. join ( PATH_STR )
17
17
}
18
18
19
19
/// Builds the path to the directory where the features are documented within the Unstable Book
20
20
/// source directory.
21
- pub fn unstable_book_lang_features_path ( base_src_path : & path :: Path ) -> path :: PathBuf {
21
+ pub fn unstable_book_lang_features_path ( base_src_path : & Path ) -> PathBuf {
22
22
unstable_book_path ( base_src_path) . join ( LANG_FEATURES_DIR )
23
23
}
24
24
25
25
/// Builds the path to the directory where the features are documented within the Unstable Book
26
26
/// source directory.
27
- pub fn unstable_book_lib_features_path ( base_src_path : & path :: Path ) -> path :: PathBuf {
27
+ pub fn unstable_book_lib_features_path ( base_src_path : & Path ) -> PathBuf {
28
28
unstable_book_path ( base_src_path) . join ( LIB_FEATURES_DIR )
29
29
}
30
30
@@ -45,7 +45,7 @@ pub fn collect_unstable_feature_names(features: &Features) -> BTreeSet<String> {
45
45
. collect ( )
46
46
}
47
47
48
- pub fn collect_unstable_book_section_file_names ( dir : & path :: Path ) -> BTreeSet < String > {
48
+ pub fn collect_unstable_book_section_file_names ( dir : & Path ) -> BTreeSet < String > {
49
49
fs:: read_dir ( dir)
50
50
. expect ( "could not read directory" )
51
51
. map ( |entry| entry. expect ( "could not read directory entry" ) )
@@ -60,7 +60,7 @@ pub fn collect_unstable_book_section_file_names(dir: &path::Path) -> BTreeSet<St
60
60
///
61
61
/// * hyphens replaced by underscores,
62
62
/// * the markdown suffix ('.md') removed.
63
- fn collect_unstable_book_lang_features_section_file_names ( base_src_path : & path :: Path )
63
+ fn collect_unstable_book_lang_features_section_file_names ( base_src_path : & Path )
64
64
-> BTreeSet < String > {
65
65
collect_unstable_book_section_file_names ( & unstable_book_lang_features_path ( base_src_path) )
66
66
}
@@ -69,12 +69,11 @@ fn collect_unstable_book_lang_features_section_file_names(base_src_path: &path::
69
69
///
70
70
/// * hyphens replaced by underscores,
71
71
/// * the markdown suffix ('.md') removed.
72
- fn collect_unstable_book_lib_features_section_file_names ( base_src_path : & path:: Path )
73
- -> BTreeSet < String > {
72
+ fn collect_unstable_book_lib_features_section_file_names ( base_src_path : & Path ) -> BTreeSet < String > {
74
73
collect_unstable_book_section_file_names ( & unstable_book_lib_features_path ( base_src_path) )
75
74
}
76
75
77
- pub fn check ( path : & path :: Path , bad : & mut bool ) {
76
+ pub fn check ( path : & Path , bad : & mut bool ) {
78
77
// Library features
79
78
80
79
let lang_features = collect_lang_features ( path, bad) ;
0 commit comments