aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/codegen/gen_assists_docs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/src/codegen/gen_assists_docs.rs')
-rw-r--r--xtask/src/codegen/gen_assists_docs.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/xtask/src/codegen/gen_assists_docs.rs b/xtask/src/codegen/gen_assists_docs.rs
index 6da5ca89e..31d606535 100644
--- a/xtask/src/codegen/gen_assists_docs.rs
+++ b/xtask/src/codegen/gen_assists_docs.rs
@@ -4,7 +4,7 @@ use std::{fs, path::Path};
4 4
5use crate::{ 5use crate::{
6 codegen::{self, extract_comment_blocks_with_empty_lines, Mode}, 6 codegen::{self, extract_comment_blocks_with_empty_lines, Mode},
7 project_root, Result, 7 project_root, rust_files, Result,
8}; 8};
9 9
10pub fn generate_assists_docs(mode: Mode) -> Result<()> { 10pub fn generate_assists_docs(mode: Mode) -> Result<()> {
@@ -46,12 +46,8 @@ fn reveal_hash_comments(text: &str) -> String {
46 46
47fn collect_assists() -> Result<Vec<Assist>> { 47fn collect_assists() -> Result<Vec<Assist>> {
48 let mut res = Vec::new(); 48 let mut res = Vec::new();
49 for entry in fs::read_dir(project_root().join(codegen::ASSISTS_DIR))? { 49 for path in rust_files(&project_root().join(codegen::ASSISTS_DIR)) {
50 let entry = entry?; 50 collect_file(&mut res, path.as_path())?;
51 let path = entry.path();
52 if path.is_file() {
53 collect_file(&mut res, path.as_path())?;
54 }
55 } 51 }
56 res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id)); 52 res.sort_by(|lhs, rhs| lhs.id.cmp(&rhs.id));
57 return Ok(res); 53 return Ok(res);