File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,11 @@ pub fn collect_unstable_feature_names(features: &Features) -> BTreeSet<String> {
56
56
pub fn collect_unstable_book_section_file_names ( dir : & path:: Path ) -> BTreeSet < String > {
57
57
fs:: read_dir ( dir)
58
58
. expect ( "could not read directory" )
59
- . into_iter ( )
60
59
. map ( |entry| entry. expect ( "could not read directory entry" ) )
61
60
. filter ( dir_entry_is_file)
62
- . map ( |entry| entry. file_name ( ) . into_string ( ) . unwrap ( ) )
63
- . filter ( |n| n . ends_with ( ". md") )
64
- . map ( |n| n . trim_right_matches ( ".md" ) . to_owned ( ) )
61
+ . map ( |entry| entry. path ( ) )
62
+ . filter ( |path| path . extension ( ) . map ( |e| e . to_str ( ) . unwrap ( ) ) == Some ( " md") )
63
+ . map ( |path| path . file_stem ( ) . unwrap ( ) . to_str ( ) . unwrap ( ) . into ( ) )
65
64
. collect ( )
66
65
}
67
66
You can’t perform that action at this time.
0 commit comments