diff --git a/src/doc/unstable-book/src/language-features/crate_in_paths.md b/src/doc/unstable-book/src/language-features/crate-in-paths.md similarity index 100% rename from src/doc/unstable-book/src/language-features/crate_in_paths.md rename to src/doc/unstable-book/src/language-features/crate-in-paths.md diff --git a/src/doc/unstable-book/src/language-features/extern_absolute_paths.md b/src/doc/unstable-book/src/language-features/extern-absolute-paths.md similarity index 100% rename from src/doc/unstable-book/src/language-features/extern_absolute_paths.md rename to src/doc/unstable-book/src/language-features/extern-absolute-paths.md diff --git a/src/doc/unstable-book/src/language-features/extern_in_paths.md b/src/doc/unstable-book/src/language-features/extern-in-paths.md similarity index 100% rename from src/doc/unstable-book/src/language-features/extern_in_paths.md rename to src/doc/unstable-book/src/language-features/extern-in-paths.md diff --git a/src/doc/unstable-book/src/language-features/match_default_bindings.md b/src/doc/unstable-book/src/language-features/match-default-bindings.md similarity index 100% rename from src/doc/unstable-book/src/language-features/match_default_bindings.md rename to src/doc/unstable-book/src/language-features/match-default-bindings.md diff --git a/src/tools/tidy/src/unstable_book.rs b/src/tools/tidy/src/unstable_book.rs index a4a35a706fd91..6ffe78eab4108 100644 --- a/src/tools/tidy/src/unstable_book.rs +++ b/src/tools/tidy/src/unstable_book.rs @@ -49,7 +49,7 @@ pub fn collect_unstable_feature_names(features: &Features) -> BTreeSet { features .iter() .filter(|&(_, ref f)| f.level == Status::Unstable) - .map(|(name, _)| name.to_owned()) + .map(|(name, _)| name.replace('_', "-")) .collect() } @@ -60,7 +60,7 @@ pub fn collect_unstable_book_section_file_names(dir: &path::Path) -> BTreeSet, dir: &str set .iter() .map(|ref n| format!(" - [{}]({}/{}.md)", - n, + n.replace('-', "_"), dir, - n.replace('_', "-"))) + n)) .fold("".to_owned(), |s, a| s + &a + "\n") } @@ -96,14 +96,17 @@ fn generate_unstable_book_files(src :&Path, out: &Path, features :&Features) { let unstable_section_file_names = collect_unstable_book_section_file_names(src); t!(fs::create_dir_all(&out)); for feature_name in &unstable_features - &unstable_section_file_names { - let file_name = format!("{}.md", feature_name.replace('_', "-")); + let feature_name_underscore = feature_name.replace('-', "_"); + let file_name = format!("{}.md", feature_name); let out_file_path = out.join(&file_name); - let feature = &features[&feature_name]; + let feature = &features[&feature_name_underscore]; if has_valid_tracking_issue(&feature) { - generate_stub_issue(&out_file_path, &feature_name, feature.tracking_issue.unwrap()); + generate_stub_issue(&out_file_path, + &feature_name_underscore, + feature.tracking_issue.unwrap()); } else { - generate_stub_no_issue(&out_file_path, &feature_name); + generate_stub_no_issue(&out_file_path, &feature_name_underscore); } } }