Skip to content

Commit 8525eb8

Browse files
committed
Auto merge of #42722 - est31:master, r=Mark-Simulacrum
Remove SUMMARY.md of the unstable book as its autogenerated Its being autogenerated now, as of PR #42612. It seems I forgot to remove it. Also, sort the entries of SUMMARY.md alphabetically.
2 parents 8e26c0e + 696085f commit 8525eb8

File tree

3 files changed

+14
-239
lines changed

3 files changed

+14
-239
lines changed

src/doc/unstable-book/src/SUMMARY.md

-225
This file was deleted.

src/tools/tidy/src/unstable_book.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::collections::HashSet;
11+
use std::collections::BTreeSet;
1212
use std::fs;
1313
use std::path;
1414
use features::{collect_lang_features, collect_lib_features, Features, Status};
@@ -45,15 +45,15 @@ fn dir_entry_is_file(dir_entry: &fs::DirEntry) -> bool {
4545
}
4646

4747
/// Retrieve names of all unstable features
48-
pub fn collect_unstable_feature_names(features: &Features) -> HashSet<String> {
48+
pub fn collect_unstable_feature_names(features: &Features) -> BTreeSet<String> {
4949
features
5050
.iter()
5151
.filter(|&(_, ref f)| f.level == Status::Unstable)
5252
.map(|(name, _)| name.to_owned())
5353
.collect()
5454
}
5555

56-
pub fn collect_unstable_book_section_file_names(dir: &path::Path) -> HashSet<String> {
56+
pub fn collect_unstable_book_section_file_names(dir: &path::Path) -> BTreeSet<String> {
5757
fs::read_dir(dir)
5858
.expect("could not read directory")
5959
.into_iter()
@@ -69,7 +69,7 @@ pub fn collect_unstable_book_section_file_names(dir: &path::Path) -> HashSet<Str
6969
/// * hyphens replaced by underscores
7070
/// * the markdown suffix ('.md') removed
7171
fn collect_unstable_book_lang_features_section_file_names(base_src_path: &path::Path)
72-
-> HashSet<String> {
72+
-> BTreeSet<String> {
7373
collect_unstable_book_section_file_names(&unstable_book_lang_features_path(base_src_path))
7474
}
7575

@@ -78,7 +78,7 @@ fn collect_unstable_book_lang_features_section_file_names(base_src_path: &path::
7878
/// * hyphens replaced by underscores
7979
/// * the markdown suffix ('.md') removed
8080
fn collect_unstable_book_lib_features_section_file_names(base_src_path: &path::Path)
81-
-> HashSet<String> {
81+
-> BTreeSet<String> {
8282
collect_unstable_book_section_file_names(&unstable_book_lib_features_path(base_src_path))
8383
}
8484

src/tools/unstable-book-gen/src/main.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extern crate tidy;
1717
use tidy::features::{Feature, Features, collect_lib_features, collect_lang_features};
1818
use tidy::unstable_book::{collect_unstable_feature_names, collect_unstable_book_section_file_names,
1919
PATH_STR, LANG_FEATURES_DIR, LIB_FEATURES_DIR};
20-
use std::collections::HashSet;
20+
use std::collections::BTreeSet;
2121
use std::io::Write;
2222
use std::fs::{self, File};
2323
use std::env;
@@ -48,9 +48,9 @@ fn generate_stub_no_issue(path: &Path, name: &str) {
4848
name = name)));
4949
}
5050

51-
fn hset_to_summary_str(hset: HashSet<String>, dir: &str
51+
fn set_to_summary_str(set: &BTreeSet<String>, dir: &str
5252
) -> String {
53-
hset
53+
set
5454
.iter()
5555
.map(|ref n| format!(" - [{}]({}/{}.md)",
5656
n,
@@ -63,16 +63,16 @@ fn generate_summary(path: &Path, lang_features: &Features, lib_features: &Featur
6363
let compiler_flags = collect_unstable_book_section_file_names(
6464
&path.join("compiler-flags"));
6565

66-
let compiler_flags_str = hset_to_summary_str(compiler_flags,
67-
"compiler-flags");
66+
let compiler_flags_str = set_to_summary_str(&compiler_flags,
67+
"compiler-flags");
6868

6969
let unstable_lang_features = collect_unstable_feature_names(&lang_features);
7070
let unstable_lib_features = collect_unstable_feature_names(&lib_features);
7171

72-
let lang_features_str = hset_to_summary_str(unstable_lang_features,
73-
LANG_FEATURES_DIR);
74-
let lib_features_str = hset_to_summary_str(unstable_lib_features,
75-
LIB_FEATURES_DIR);
72+
let lang_features_str = set_to_summary_str(&unstable_lang_features,
73+
LANG_FEATURES_DIR);
74+
let lib_features_str = set_to_summary_str(&unstable_lib_features,
75+
LIB_FEATURES_DIR);
7676

7777
let mut file = t!(File::create(&path.join("SUMMARY.md")));
7878
t!(file.write_fmt(format_args!(include_str!("SUMMARY.md"),

0 commit comments

Comments
 (0)